IOS开发常见warning汇总

  • Warning: Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier网络

    • 解释:Storyboard中有View Controller没有入口,运行时不能访问到app

    • 解决办法:ide

      • 查看storyboard中第一个view有没有勾选“Is Initial View Controller”ui

      • 查看storyboard中有没有孤立的view(即跟其余view没有连线)code

  • Warning: Cannot verify client 3000get

    • 解释:上传应用时App Store不能验证当前证书。cmd

    • 解决办法:it

      • 若是证书已过时,更新后重试io

      • 清理本地环境,从新archive编译

        • Shift+cmd+k

        • Shift+alt+cmd+k

  • Warning: Can't find keyplane that supports type 4 for keyboard iPhone-PortraitTruffle-NumberPad; using 1892650032_PortraitTruffle_iPhone-Simple-Pad_Default

    • 解释:UITextField指定的键盘类型为"Number Pad",每次弹出键盘前都会有此警告。经多方调查,目前定义为IOS的bug. 功能一切正常。

    • 环境:IOS8.0,Xcode7.2

    • 解决办法:

      • 无解

      • 若是模拟器中没法弹出键盘,请检查设置:iOS Simulator -> Hardware -> Keyboard -> Connect Hardware Keyboard

  • Warning: can't load underlying module for "SKPhotoBrowser"

    • 解释:Xcode7.3的一个bug。首次使用CocoaPods安装"SKPhotoBrowser"后,使用语句"import SKPhotoBrowser"导入时会有此警告。该错误也会发生在其余CocoaPods模块。

    • 环境:IOS8.0, Xcode7.3

    • 解决办法:

      • 忽略警告,直接编译便可消除。

  • Warning: Unknown class xxx in Interface Builder file

    • 解释:Story board中指定的class不可见,可能的缘由是storyboard中该view controller指定的class使用了错误的module.

    • 环境:IOS8.0, Xcode7.3

    • 解决办法:storyboard中找到该class被引用的view,"Show the identify inspector"->"Custom Class"->"Module" 将module置空,即便用通用module。

  • Warning: ld: framework not found XXXXX

    • 解释:没法链接到特定的framework

    • 环境:IOS8.0,Xcode7.3

    • 解决办法:选择"target"->"General"->"Linked Frameworks and Libraries",将不须要的framwork删除。注意,若是使用cocoapods,这里的target将与Podfile中定义的一致。

  • Warning: App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

    • 解释:默认状况下访问网络应该使用HTTPS。若是须要HTTP访问则须要添加配置。

    • 环境:IOS8.0, Xcode7.3.1

    • 解决办法:info.plist中添加属性App Transport Security Settings,该属性为Dictionary. 在该属性下添加子属性Allow Arbitrary Loads,并设置为YES

相关文章
相关标签/搜索