'Unrecognized selector sent to instance'

别等时光非礼了梦想. 提交于 2019-11-28 11:47:10

问题


I am receiving the following Error

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

at the following lines of "basicInfoViewController.m":

 contactInfoViewController *destViewController = segue.destinationViewController;
 destViewController.thisViewData = [[NSMutableDictionary alloc] initWithDictionary:self.viewData];

My contactInfoViewController.h looks like

@interface contactInfoViewController : UIViewController
{
    NSMutableDictionary *thisViewData;
}
@property(nonatomic, strong) NSMutableDictionary *thisViewData;

and i have included the

@synthesize thisViewData;

for the implementation. Why am I getting this error ?


回答1:


Looks like you haven't set the class for the UIViewController in interface builder so instead of getting a contactInfoViewController you are getting a UIViewController.



来源:https://stackoverflow.com/questions/13047705/unrecognized-selector-sent-to-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!