我觉得我在这里撞墙(而且我已经准备好这么做了,坦率地说)。[UILabel copyWithZone:]:无法识别的选择器发送到实例
我想设置背景的视图。背景我需要设置为图像,我使用此代码(其中工程在另外两个子类的UIViewController完美的罚款 - 这是一个复制/粘贴到新的文件):
UIImage *img = [gameNode imageFromKey:@"background"];
UIColor *bg = [[UIColor alloc] initWithPatternImage:img];
self.view.backgroundColor = bg;
[bg release];
正如我所说的,这工作在其他两个地方完全正常的,但是在这里,线self.view.backgroundColor = bg
抛出
'NSInvalidArgumentException', reason: '-[UILabel copyWithZone:]: unrecognized selector sent to instance 0x9259840'
有没有更多的去了。我在IB中验证过,顶层视图的引用出口设置为文件的所有者。我清理了该项目并重新启动。我甚至关闭了Xcode并重新启动它 - 没有运气。我还有什么遗漏?
编辑:正如我所说,没有太多的回堆栈跟踪,只是这:
2012-05-28 13:13:56.997 OOKL[36012:17303] -[UILabel copyWithZone:]: unrecognized selector sent to instance 0x92b79a0
2012-05-28 13:13:56.997 OOKL[36012:17303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UILabel copyWithZone:]: unrecognized selector sent to instance 0x92b79a0'
*** First throw call stack:
(0x2933052 0x44c7d0a 0x2934ced 0x2899f00 0x2899ce2 0x2935bd9 0xaa92dd 0x6a4f40 0x6a4eeb 0x6bfd60 0xc0191a 0x2934e1a 0x289e821 0xc0046e 0xaa7e2c 0xaa83a9 0xaa85cb 0xb2b59 0xb1969 0x2934ec9 0x9e55c2 0x9e555a 0xa8ab76 0xa8b03f 0xa8a2fe 0xa0aa30 0xa0ac56 0x9f1384 0x9e4aa9 0x2ac6fa9 0x29071c5 0x286c022 0x286a90a 0x2869db4 0x2869ccb 0x2ac5879 0x2ac593e 0x9e2a9b 0x214d 0x20c5)
闲来无事 - 之前或之后。
您的标签在此视图中是否正确连接?看起来像IB中的标签问题。在.h文件中创建一个像这样的访问器。 @property(assign)IBOutlet UILabel * label; –
你可以发布回溯 – 0x8badf00d
在你的gdb或lldb控制台中,输入bt来获取回溯 – 0x8badf00d