iOS项目之报错笔记

问题一:

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

    原因:导入了.m的头文件,导致同时有两个一样的.m文件在编译

问题二:

    Xcode真机测试报错:Could not launch “xxx”

    解决方案一:1.删除/Users/(用户名)/Library/Developer/Xcode/DerivedData/(对应APP程序)文件夹

                     2.拔掉手机,删除对应的APP程序,完全退出Xcode工具

                     3.重新连接手机进行真机测试

    解决方案二:进行过真机抓包测试,关闭HTTP代理

    解决方案三:1.选择手机中“设置” -> “通用” -> “设备管理” -> 选择自己对应的开发商应用 -> “删除应用”

        2.重新运行Xcode中的程序,这个时候应该还会报错

          3.再次进入自己对应的开发商应用 -> “验证应用”

          4.再次运行Xcode中的程序就OK了

    

  情况二:

    

  xcode为11+

    

  分析原因:

    在网上找了很多关于Could not launch "xxx"的原因,都没有解决自己的问题,然后自己进行检查配置时,发现了证书配置问题,修改证书后,就没有再出现这样的问题了,于是把这个记录一下。

  解决方案:

    

    这里根据自己的环境配置对应的证书。

  情况三:

     

   解决方案:在下载一些第三方demo时,运行到真机上会出现这样的提示信息,需要在“设置” -> “通用” -> “设备管理”-> 点击信任

 

问题三:

    Warning! ivar size mismatch in PSUICollectionView_ of 80 bytes - can't change the superclass.

    解决:1.搜索PSUICollectionView,找到.m文件

            2.搜索char filler,在[]中的数据上加上警告提示的数据

 

问题四:

    ***Terminating app due to uncaught exception '...', reason:'[<...>  setValue:forUndefinedKey:]:this class is not key value coding-compliant for the key ....'

    问题原因:xib中连线出问题

 

问题五:

    ***Terminating app due to uncaught exception '...', reason:'-[... ...]:unrecognized selector sent to instance ...'

    问题原因:某个对象没有实现某个方法

 

问题六:

  iOS国际化时遇到的错误:read failed: the data couldn't be read because it isn't in the correct format.

  问题原因:在国际化的时候,写key,写着写着就忘了加 ";"

 

问题七: 

  *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [187.5 nan]'

  问题原因:某个控件在设置CGRect类型的属性(如frame、bounds、......)中宽高设置了0,导致程序在计算中除以了0。

 

问题八:

  Xcode意外闪退,错误信息:

Process:               Xcode [587]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               8.2.1 (11766.1)

Date/Time:             2017-03-13 13:44:38.076 +0800
OS Version:            Mac OS X 10.12.3 (16D32)
Report Version:        12

Time Awake Since Boot: 150 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Application Specific Information:
ProductBuildVersion: 8C1002
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): Error getting value for key 'strategyClass' of extension 'KSImageNamed.CompletionStrategy.ImageNamed' in plug-in 'com.ksuther.KSImageNamed'
UserInfo: {
    ......
}
Hints: None

  解决问题:找到/Users/(用户名)/Library/Developer/Xcode/Plug-ins文件夹,将里面的KSImageNamed.ideplugin插件删除,重启Xcode。

问题九:Warning:whose view is not in the window hierarchy!

  分析:可能在界面完全退出之前,进行展示信息界面(如Alert)。

  解决:修改调用的顺序,在界面退出之后在展示。

 

问题十:

  The behavior of the UICollectionViewFlowLayout is not defined because:

  the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.

  分析:automaticallyAdjustsScrollViewInsets根据按所在界面的status bar,navigationbar,与tabbar的高度,自动调整scrollview的 inset

  解决:在viewDidLoad方法中添加 self.automaticallyAdjustsScrollViewInsets = NO;

 

问题十一:

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

  

  分析:在项目中使用了第三方,但没有被添加到编译列表中

  解决:项目 -> TARGETS -> Build Phases -> Compile Sources,点击 + 号进行添加对应的 .m文件

 

posted @ 2016-03-16 09:00  兔.小白  阅读(2076)  评论(0编辑  收藏  举报