I have run across this warning and can see it is the third element, date picker that is failing in the table view cell. The picker will not activiate on taps from the view cell…I am assuming because of the warning but perhaps I have done something else wrong…any one help me out here?
2018-01-15 14:38:30.215131-0800 Checklists[11242:883617] [Warning] Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell’s content view. We’re considering the collapse unintentional and using standard height instead.
This seems to indicate that you might not have enough constraints (perhaps on the date picker) in order for iOS to be figure out the height of the table view cell. This would normally happen if you forgot to set up the relevant height or top and bottom constraints. You might want to check that.
However, I don’t know if that is actually the issue you’re facing. As @jayantvarma mentioned, we really need to see the working code in order to figure out what is going on. However, posting part of a Swift file isn’t going to help much either since it’s easier to actually run the app and see what is going on So if you can upload your full project as a ZIP file somewhere and then provide a link to that here, I (or somebody else) can take a look and help you.
I checked the contraints and have four on the date picker.
I have attached the entire project here, hopefully it is there…I appreciate the help as I am still learning all this given I am ancient, programming in the 70’s
Thank you for the advice. I just looked at that and it seems interesting, perhaps beyond my knowledge to date but would be helpful once I master a few more things I have been playing with layouts on the side quite a bit and just getting use to the concepts of these contraints.
from your previous comment, The UI layer is easy but takes a bit of time to get used to, add to that asynchronous can be a challenge. If you are in your 70’s that’s great, would love to know how you are progressing with your adventure in programming.
well, my background is undergrad and grad computer science. Started PhD but didn’t really need that for wht i was doing in my career. I have extensively programmed in Fortran (all of them), C, C++, Java, JavaScript, PHP, Ada (not really around anymore but a full environment unlike the others), Python, Tck/Tk, all UNIX shell scripting…you get the picture. I spend most of my time these days managing medium to larger scale IT shops that also do development. Development, ERP/CRM/MRP and all the things inbetween thst make a business run. So I have a solid understanding of constructs as well as MVC but while I developed something like this in the 90’s for Cray Research/Sun Microsystems ( you probably don;t now the CS6400?), iOS is much more comprehensive though the thoughts are the same just deeper. Asynchronous really not a problem for me. I developed software fo near real time data acquisition for communication satellites so that and MVC is well understood, just need to know the callbacks (yes old term) for the various delegates and segues, etc. I enjoy frameworks just takes a lot of time to learn but once learned things go fast!
I started coding back in the '80s - so I think I kind of understand where you’re coming from
I took a look at the project and there were two issues. The first one, the warning you were seeing, did not have anything to do with the second one, the date picker not appearing.
Here’s what was happening:
The table view for that view controller had the row height set to Automatic. Since the code calls the method on the superclass to get the cell height, and the tableview on the storyboard did not have an explicit row height, you were seeing the warning that you saw. You can fix this by setting the table view’s default row height to 44 or something similar. This should not cause any major issues would be my feeling.
The tableview on your storyboard had its Selection property (you can access this via the Attributes inspector) set to No Selection. This is why you weren’t getting the date picker. No Selection means that you cannot select rows on the table view. So none of your taps on the rows had any effect. That property should be set to to Single Selection. Once that change was made, the date picker showed up fine
Ok thank you for the professional advice that repaired that but now a crash, I have a different problem now that I will investigate and repair so I may learn. Otherwise will come back for advise
Set a breakpoint on line 34 and check the values of the relevant variables if you want to fix this on your own …
If not, you can check my answer below by expanding the “Solution” to see a possible issue based on just the crash error message …
Solution
It is possible that you forgot to hook up the outlet for dueDateLabel. Generally, when you get a crash related to nil while unwrapping an Optional, this is the case
Of course, it is also possible that the issue is actually with dueDate itself but the former is the more likely scenario.
You guys are really great! I learned all of computer science the hard way back in the day…languages, patterns, object orientation, etc…but few ever helped like this. Something close to may heart. I have mentored and helped and love doing it today when I can. I’ll say under a 100 but maybe more than a 100 in my career. The world today with current mediums can help millions like you are doing.
It is a shame the knowledge I have was not passed off to you all so you could move even faster, but such is life! You are doing quite well!
I will work on this and if needed I will look at your solution. Thank you!
Thank you for the help, I had few other problems as well but it finally works! I did peak at your solution, it was the case and a good tip when unwrapping results in nil !
Thank you, love the exercises at the end. One question. If one checks an item as done before the notification date/time expires, the notification still fires, correct?
Yes, it does And that’s actually a bug, if you look at it in real-world terms. So, if you want an additional exercise, you might want to look at adding the functionality to remove an existing notification via the configureCheckmark method …