【发布时间】:2015-06-29 14:50:55
【问题描述】:
我制作了 UIView xib。在另一个类调用该 xib 之后, 它运作良好。连接插座直到工作。
UIView *containerView = [[[NSBundle mainBundle] loadNibNamed:@"CommentTextView" owner:self options:nil] lastObject];
[self.view addSubview:containerView];
但是如果outlet也连接了,就会出现异常:
2015-04-22 15:14:50.456 MUZEwithCollectionView[17123:3315297] Interface Builder 文件中的未知类 CommentUITableView。
2015-04-22 15:14:50.510 MUZEwithCollectionView[17123:3315297] *** 由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:]:此类不是键值编码-符合关键的commentTextView。'
*** 首先抛出调用堆栈: (0x1834042d8 0x194bd80e4 0x183403f5c 0x18423d480 0x18332f520 0x1882647a0 0x1882665a8 0x1000d160c 0x187e44c84 0x187e44994 0x18853a2fc 0x18814a148 0x1881663e4 0x188168934 0x187f32158 0x187e79404 0x187e624e0 0x187e78da0 0x187e37fc0 0x187e72898 0x187e71f50 0x187e4518c 0x1880e6324 0x187e436a0 0x1833bc240 0x1833bb4e4 0x1833b9594 0x1832e52d4 0x18cb036fc 0x187eaafac 0x1000e3840 0x195256a08) libc++abi.dylib:以 NSException 类型的未捕获异常终止
我是不是在某个地方弄错了?
【问题讨论】:
-
您是否将任何 ViewController 类绑定到此 UIView?
标签: ios objective-c xcode