Crash以及报错总结

CoreData: Cannot load NSManagedObjectModel.nil is an illegal URL parameter

这是因为在工程中CoreData的命名和AppDelegate中使用的命名不同造成的,可能是自己修改了CoreData文件但是忘记修改AppDelegate中相应的字符串。
将图片中的字符串改成和CoreData文件名一样就可以了。

No such file or directory ......

找不到某个文件 首先复制文件名 在Build Phases下找
浅白色说明文件找不到了

linker command failed with exit code 1(use -v to see invocation)

文件冲突 左下角搜文件
通常有两种情况 1.有两个相同文件 2.只有一个的时候command+shift+f 搜索 ~~.m 看是否引入.m

Application tried to push a nil view controller on target

试图推出空的试图控制器

must pass a class of kind UITableViewCell

注册方法是否对 打全局断点

分区头乱窜

可能是view的问题可能是frame=头的frame 所以头在相对于tableView偏移的基础上再偏移一次 改为bouns相对于自己
tableView 有自己头试图和尾视图 区的头尾有方法实现可以注册重用池也可以不用重用池[有内存问题不能释放view]

轮播图: 上下滚动时轮播图不走

因为定时器是默认状态下是defaultMode 所以在滚动UITrackingRunLoopMode时好像暂停了一样
在定时器中添加下面一段话:
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
定时器不参与引用计数 直接置空

真机测试时无法运行。报错如下:

You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library

  • 我用的是Xcode7.1 可能是第三方库不兼容。7.0以上默认开启 ENABLE_BITCODE
    三方库编译的时候没有 ENABLE_BITCODE

    解决办法:
    有两种: 1.修改工程设置 2.修改第三方库
    第二种没研究,以后涉及会补充。
    第一种:
    在build setting 中搜索 enable bitcode 修改为NO


    如图

    bitcode参考资料

真机测试 could not find developer disk image

stackoverflow上得答案
我用的是Xcode7.1 手机是9.2 真机的系统过高

解决办法:

  1. 更新Xcode
  2. 或者将 将9.2的文件添加进去 路径 /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
    ![7.1]
    (https://www.dropbox.com/s/dledmlnhb6my5x3/Xcode7.1%E6%96%87%E4%BB%B6%E5%A4%B9.png?dl=1)
    下载地址
修改相对路径

方法:
$(SRCROOT) /AutoLayoutAnimation/EaseUI/EaseUI-Prefix.pch

tableView Crash:

'UITableView (<UITableView: 0x7fd26b090a00; frame = (0 94; 320 568); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x7fd26abdc0b0>; layer = <CALayer: 0x7fd26ab4a4e0>; contentOffset: {0, 0}; contentSize: {320, 44}>) **failed to obtain a cell from its dataSource** (<FiestViewController: 0x7fd26954c500>)'
先循环使用了cell,后又创建cell

treating unicode character as whitespace

可能是因为空格问题 重写一遍就好了

CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 9.1'

证书问题

1.选择工程->Build Settings -> Code Signing -> Code Signing Identity -> Debug -> Any ios SDK 将选项改为:iPhone Developer
2.重新下载你的证书,或者修改通配符,或者说修改你的appid 。选择工程 -》Bundle Identifier 修改为最新的appid 。造成这种原因是因为你修改了你的app sdk版本

16/03/26

CUICatalog: Invalid asset name supplied:

项目中搜索UIImage imageNamed:

Local declaration of 'XXX' hides instance variable

因为本地变量跟函数参数变量同名

'invalid nib registered for identifier (cell) - nib must contain exactly one top level object which

检查nib文件内是否拖拽了两个cell 或者其他的什么。

-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "XXXView" nib but the view outlet was not set.'

nib文件与ViewControler没有关联成功
1, 打开nib文件
2, 点击"File's Owner", 按command+4,设置Class为xxxViewControler
3, 按Control+"Files's Owner", 里面有个默认的IBOutlet变量view, 看一下后面有没有做关联,如果没有就拉到下面的View和视图做个关联

今天运行百度鹰眼Demo的时候鹰眼dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from:

按照网上说的删除缓存文件重启仍没办法解决
后来发现问题是没有serviceID AK 及 安全码的问题

[None of the input catalogs contained a matching launch image set named "XXXXX".]

缺什么就Assets.xcassets上右键新建什么就OK啦。

NSUserDefaults报错attempt to insert non-property list object

value的数据是 NULL

if ([Value isEqual:[NSNull null]])
{
Value = @"";
}

-[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]’

NSArray或NSDictionary插入数据为空而造成的

'-[__NSCFString count]: unrecognized selector sent to instance 0x7ff57bee12d0'

快速定位出错位置:采用僵尸断点和全局断点


1

2


-[NSObject(NSObject)doNotRecognizeSelector:]


定位

系统已经设置中文,app内仍提示英文及复制粘贴也为英文

在Supporting Files 中的info.plist 中将 Localization native development region改为China即可

The certificate used to sign "app名" has either expired or has been revoked. An updated ....

证书失效 重新生成

Supported orientations has no common orientation with the application

检查横屏

 



文/Karen_(简书作者)
原文链接:http://www.jianshu.com/p/0ac7813d5d86
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
原文地址:https://www.cnblogs.com/dzhs/p/5566270.html