Xcode: Invalid parameter not satisfying
I've find a Debug way may help you debug where is the exception occurred and may help someone to debug with exception.
navigate to breakpoint
Click the add button, and choose exception Breakpoint
Add breakpoint and make exception type to Objective-C
Run the code It will stop at the line which make crash happened!
Hope this help~
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];
}