I have a iPad app, using XCode 4.5, Storyboards, iOS 6 and MagicalRecord. This code is causing the error, and I don’t see why. Both aApptStart and selectedStartDate are defined as DateTime. So, what is causing this?
Here is the offending code:
- (IBAction)saveAppointment:(UIButton *)sender {
NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread];
AppointmentInfo *newAppointment = [AppointmentInfo createEntity]; // create the entity
NSLog(@"Selected start Date (save): %@", [self formatSelectedDate: selectedStartDate]);
newAppointment.aApptStart = selectedStartDate; // <------ causing the error
newAppointment.aApptEnd= selectedEndDate;
newAppointment.aTech = selectedTech;
[localContext MR_saveNestedContexts];
}
Here is the error I’m getting:
Terminating app due to uncaught exception
‘NSInvalidArgumentException’, reason: ‘-[NSManagedObject
setAApptStart:]: unrecognized selector sent to instance 0xee85dd0’
The error indicates that there is no property of that name in AppointmentInfo.
Well, does your NSManagedObject subclass (AppointmentInfo) declare the property aApptStart? Also, does a corresponding attribute for your entity exist (if the property is implemented
@dynamically)?I guess it would…. Maybe a typo?
Can you show interface and implementation of AppointmentInfo?