gpt4 book ai didi

objective-c - “无法识别的选择器发送到实例”

转载 作者:行者123 更新时间:2023-11-29 04:20:26 25 4
gpt4 key购买 nike

我收到以下错误

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com