我收到以下错误

[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;


用于实施。
为什么会出现此错误?

最佳答案

似乎您尚未在界面构建器中设置UIViewController的类,因此不是获取contactInfoViewController,而是获取UIViewController。

关于objective-c - “无法识别的选择器已发送到实例”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13047705/

10-14 00:01