I'm getting crashes from my UIDatePicker view and I think it's because I'm not retaining the pickers selected date. Can anyone tell me if this could be correct?
I have a modal view for selecting a toDate and a fromDate range. These values are passed into the modal view and grabbed out of the view when it's dismissed. The view has one UIDatePicker and a segmented button for switching between the to and from dates.
Every time the segmented control switches I set the pickers date to the matching to or from date. When the picker value changes I update the to or from dates accordingly. The view crashes after a couple of switches between these dates.
I'm not retaining the pickers selected date so I'm guessing when I set the value of the pickers date from the toDate to the fromDate the toDate is being released so when I switch the picker back to the toDate it's going to crash.
Also to use the selected date from the picker outside the view will the date need to be retained as the picker will be released along with the date?
Does this make sense to anyone?