2011-11-22 60 views
0

IM使用这learncontroller.hNSUnknownKeyException新观点

IBOutlet UIView *splashView; 

@property (nonatomic, retain) IBOutlet UIView *splashView; 

,并从这里当一个按钮CLIK .M

[splashView setTag:1000]; 
[self.view addSubview:splashView]; 

所以我转移到下一个视图,名为view01 IT表示

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<View01 0x56816c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key splashView.' 
+0

[此类不是密钥的关键值编码兼容性]的可能重复(http://stackoverflow.com/questions/3088059/this-class-is-not-key-value - 编码兼容的键) – jtbandes

回答

0

要么你忘了把它连接到你的nib文件中,因为它被声明为IBOutlet,或者你在将你的代码从一个地方粘贴到另一个地方时犯了一些错误(可能你忘了复制.xib文件。 h和.m文件)

+0

没有在XIB它是2 views1>查看和2> splashview所以我连接splashview到文件所有者 – Jay

+0

文件所有者应连接到视图和其他视图应连接splashView –