I don't understand! I'm a novice, so this may be my fundamental misunderstanding of Objective-C, life, the universe and/or everything; please be gentle.
- I set the inputView for a text field to be self.datePicker - a standard UIDatePicker, which has been initialised in viewDidLoad.
- I add some subviews to the datePicker. Sounds crazy, I know, but bear with me.
- I now have that field resign first responder, and call self.datePicker = nil. Even more crazy, yes.
- I tap the textField again, and expect one of two things. Either one, no datePicker. I destroyed it, right? Needs to be re-allocated and initialised. Or two, a fresh datePicker, without the extra subviews. Not sure why I expect this (again, I destroyed it!), but hey, it's possible.
- What I get is the same picker, complete with the added subviews, plus any date that was previously set in it! What the what?!? says I.
I know you're wondering why I want to do this. Why add views to datePicker at all, and why not just remove them from their superview when needed. But let's assume I have a good reason for doing this, and doing it this way. Can anyone correct my obviously wonky understanding of object behaviour?