Xcode: Invalid parameter not satisfying
You don't check if date is null, before using it, in ex.
(void)viewDidLoad { NSDate *storedDate = [[NSUserDefaults standardUserDefaults] objectForKey:@"DatePickerViewController.selectedDate"]; // add this check and set if (storedDate == nil) { storedDate = [NSDate date]; } // --- [self.datePicker setDate:storedDate animated:NO];}
I've find a Debug way may help you debug where is the exception occurred and may help someone to debug with exception.
Run the codeIt will stop at the line which make crash happened!
Hope this help~