Just had one of those afternoons, where you waste 2 hours trying to debug some really strange crash in fairly simple code only to find that the API is at fault.
I have a UIDatePicker which I present in a (custom) UIAlertView used on the iPhone. On the iPad it makes sense to use a UIPopoverController.
However on use, it would crash about 20% of the time on the first showing, and 100% of the time on the second with various errors like:
*** -[_UIPickerViewSelectionBar lastClickRow]: unrecognized selector sent to instance 0x5570c80
*** -[_UIOnePartImageView lastClickRow]: unrecognized selector sent to instance 0x5576b70
*** -[NSCFString lastClickRow]: unrecognized selector sent to instance 0x6081770
Basically it’s just sending “
lastClickRow” to junk…
And now… what cost me 2 hours but you get for free (hey why not check out GPS Log ;)
The workaround: Set the UIViewController’s .view (to the view containing the UIDatePicker) AFTER you call presentPopoverFromRect on the UIPopoverController.
No visual glitches with the workaround.
Thanks A ._.
I could file a bug report… but I can’t stand that the iPhone bug reports are hidden, i.e. I have no idea if 100s of others haven’t already filed the same one and I may just waste my time. Already kinda regretting the waste of time on this issue.