'无法识别的选择器已发送到实例'

时间:2012-10-24 10:50:06

标签: objective-c ios cocoa-touch selector

我收到以下错误

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

用于实施。 为什么我会收到此错误?

1 个答案:

答案 0 :(得分:1)

看起来你没有在界面构建器中为UIViewController设置类,所以不是获取contactInfoViewController而是获得UIViewController。