我有一个iPad应用程序,使用XCode 4.5,故事板,iOS 6和MagicalRecord。此代码导致错误,我不明白为什么。 aApptStart
和selectedStartDate
都被定义为DateTime。那么,这是什么原因造成的?无法识别的选择器发送到核心数据导致应用程序崩溃
这里是有问题的代码:
- (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];
}
这是我得到的错误:
终止应用程序由于未捕获的异常 'NSInvalidArgumentException' 的,理由是:“ - [NSManagedObject setAApptStart:]:无法识别的选择器发送到实例0xee85dd0'
我正在重组我的答案,这有点乏味,因为我在我的ipad上。直到现在还没有看到您的评论。什么是不需要的(甚至意味着什么)以及什么不会被编译?你的答案在哪里?没有更多的细节就很难给出具体的答案。 – Mario
“很难给出一个具体的答案没有更多的细节”>>是的,这不是一个答案,因此:) –
马里奥......这确实是一个错字...非常感谢你...新年快乐给你和你的家人... – SpokaneDude