问题描述
我正在使用新的xcode 4.5,
i在某些视图控制器上有这行代码:
i am using the new xcode 4.5,i have this lines of code on some view controller:
DiscoverCell* cell=[table dequeueReusableCellWithIdentifier:@"DiscoverCell"];
if(cell==nil){
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"DiscoverCell"
owner:self
options:nil];
cell = [nib objectAtIndex:0];
}
当我运行应用程序的投掷:由于未捕获的异常终止应用程序NSInternalInconsistencyException ',理由:'NIB数据无效'。
在LoadNib行上,
是什么?这个xcode是否是一些苹果垃圾?
when i run the app its throwing: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The NIB data is invalid.'on the LoadNib line,what is that? does this xcode is some apple garbage?
推荐答案
取消选中下面图片中突出显示的使用Autolayout。 Xcode 4.5默认为您添加到项目中的新nib文件启用此属性。取消选中自动布局复选框解决了问题
Uncheck the "use Autolayout" highlighted in the below image. Xcode 4.5 enables this property by default for the new nib files you add into your project. Unchecking the autolayout check box solved the problem
这篇关于Xcode 4.5破坏XIB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!