objective-c - 无法识别的选择器发送到实例,原因

标签 objective-c ios xcode exception

每当我打电话

self.gLViewController = [[GLViewController alloc] initWithNibName:@"GLViewController" bundle:nil];
       [self.navigationController pushViewController:self.gLViewController animated:YES]; 

我收到以下错误:

2012-06-06 15:22:50.329 NavApp[5357:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MiniGamesViewController setGLViewController:]: unrecognized selector sent to instance 0x1f6aa730'
*** First throw call stack:
(0x353b788f 0x3775e259 0x353baa9b 0x353b9915 0x35314650 0xb14cf 0x353113fd 0x32e06e07 0x32e06dc3 0x32e06da1 0x32e06b11 0x32e07449 0x32e0592b 0x32e05319 0x32deb695 0x32deaf3b 0x36faa22b 0x3538b523 0x3538b4c5 0x3538a313 0x3530d4a5 0x3530d36d 0x36fa9439 0x32e19cd5 0xaeae5 0x60ce4)
terminate called throwing an exception(lldb) 

谁能帮我说说到底是什么意思?我已经为此工作了整整一个小时,但一无所获。非常感谢您的帮助!

最佳答案

您将必须合成该属性 在你的 MiniGamesViewController.m

//After the implementation
@implementation MiniGamesViewController
//Add this line
@synthesize gLViewController;

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

相关文章:

xcode - 一定时间范围内的时间分析器?

iphone - UIPickerView 编程示例?

objective-c - Objective-C 弧 : How to remove an object from an array/set and then return it as an autoreleased object?

iphone - 编写新的委托(delegate)对象与使用 View Controller 作为委托(delegate)

ios - 无法从静态库和包中加载 subview 类和 xib

iphone - 如何修复 Xcode 预期类型错误

ios - 使用试飞时应用程序崩溃

ios - 当用户终止应用程序时如何停止 MPMusicPlayerController 播放?

ios - Cocoapods 无法正确链接第三个、第四个目标(Xcode 7 beta 6)

ios - 找不到Ionic 3应用程式的'Branch.h'文件Xcode错误