iOS开发中问题集锦

269 阅读1分钟

1.UITableViewdequeueReusableCellWithIdentifier:dequeueReusableCellWithIdentifier:forIndexPath:的区别?

dequeueReusableCellWithIdentifier:forIndexPath:获取复用Cell时,Cell必须已经被注册。

2.从storyboard中加载的UIViewController,初始化方式是走initWithCoder:,而不是走initWithNibName:bundle:

3.使用Core Data编译报错Multiple commands produce....

在手动生成继承自NSManagedObject类是,编译报上述错误。因为.xcdatamodeld文件在编译时会自动生成实体类,需要禁用这个功能。