'无法识别的选择器发送到实例' [英] 'Unrecognized selector sent to instance'

查看:98
本文介绍了'无法识别的选择器发送到实例'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误

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


为什么我得到这个错误?

for the implementation. Why am I getting this error ?

推荐答案

看起来你还没有为接口UIViewController设置类生成器,而不是得到一个contactInfoViewController你得到一个UIViewController。

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.

这篇关于'无法识别的选择器发送到实例'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆