I’m getting this error in the commented line.
datachoice is an Object of UserData, which is external but I imported it.
I retained datesave in the .h as well I don’t know what Is join on, something with out release probably???
.h
#import <UIKit/UIKit.h>
@interface DateViewController : UIViewController
@property (strong, retain) IBOutlet UIDatePicker *datepick;
@property (strong, retain) IBOutlet NSDate *datesave;
- (IBAction)okDatebutton:(id)sender;
@end
.m
-(IBAction)okDatebutton:(id)sender {
datesave = [datepick date];
datechoice->date = datesave; //<-----------------here is the EXC_BAD_ACCESS
}
@end
Never(*) use the
->operator for objects. You meant:(*) There’s an obscure exception to this rule where it can be required, but it doesn’t apply to iOS, only Mac.