我收到以下错误
[UIViewController setThisViewData:]: unrecognized selector sent to instance 0x71800b0
2012-10-24 16:06:05.071 Movie Rental[5468:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController setThisViewData:]: unrecognized selector sent to instance 0x71800b0'
在“ basicInfoViewController.m ”的以下行:
contactInfoViewController *destViewController = segue.destinationViewController;
destViewController.thisViewData = [[NSMutableDictionary alloc] initWithDictionary:self.viewData];
我的 contactInfoViewController.h 看起来像
@interface contactInfoViewController : UIViewController
{
NSMutableDictionary *thisViewData;
}
@property(nonatomic, strong) NSMutableDictionary *thisViewData;
我已经包含了
@synthesize thisViewData;
用于实施。 为什么我会收到此错误?
答案 0 :(得分:1)
看起来你没有在界面构建器中为UIViewController设置类,所以不是获取contactInfoViewController而是获得UIViewController。