夜间模式暗黑模式
字体
阴影
滤镜
圆角
主题色
weak end at this time

最近在看这本书:<iOS开发指南:从零基础到App Store上架(第3版)完整版 PDF电子书下载 带书签目录.pdf>其中大多数都是storyboard的视图,而我想用xib还要自己去找xib的方法,就像复用cell的那个方法.storyboard的话不用注册xib.如果xib的话就要在- (UITableViewCell )tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath方法中给出这一段:

static BOOL nibsRegistered = NO;
if(!nibsRegistered)
{
UINib *nib = [UINib nibWithNibName:@"TableViewCell" bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:@"TableViewCell"];
nibsRegistered = YES;
}

目的是为了注册xib,如果没有注册xib的话.会报错:

* Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.5/UITableView.m:6547

吐槽一下xcode的报错,还要自己加上breakpoint,才可以停在有问题的代码上.. EXC_BAD_ACCESS code = EXC_i386_GPFLT 特么的字符串忘记写@了.真是哔了狗;

Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?没有设置 is initial View Controller storyboard;
暂无评论

发送评论 编辑评论


				
上一篇
下一篇