iOS 开发中遇到的常见问题

1. 出现错误: 虚拟机Xcode调试时候发现点击键盘出不来,命令行打印:
Can't find keyplane that supports type 8 for keyboard iPhone-Portrait-DecimalPad; using 3648623971_Portrait_iPhone-Simple-Pad_Default

解决方法:通过Hardware->Keyboard->Toggle Software Keyboard手动激活键盘。


2.出现错误:程序一运行就奔溃,但是我已经设置了storyboard的入口视图。 而且storyboard名字是Main命令行打印:

Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?

解决方法:因为给你的StoryBoard没有设置默认显示的controller。

3.出现错误:出现这个警告,命令行打印:

Null passed to a callee that requires a non-null argument

解决方法:其实错误发生在: 
我错误地写成了DISPATCH_QUEUE_PRIORITY_DEFAULT 
正确应该dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) 
从这里可以看出,xcode的警告不能忽略,而且要先从英文去理解意思先;

4.出现错误:编译出错,命令行打印:

local declareation “XXX” hide instance variable

解决方法:程序中有重名的变量,找出重名的变量并进行修改。

5.出现错误:在编写类的初始化函数时出现以下错误,命令行打印:

Cannot assign to 'self' outside of a method in the init family

源代码:

- (id) Myinit{  self = [super init];  ……}

解决方法:

- (id) initWithMy{  self = [super init];}


6. 出现错误:
 UIScrollView无法滚动
可能原因:(1)没有设置contentSize
                (2)scrollEnabled = NO
                (3)没有接收到触摸事件:userInteractionEnabled = NO
                (4)没有取消autolayout功能(如果在Storyboard中添加了ScrollView的子控件,要想scrollView滚动,必须取消autolayout).


7.出现错误:下载图片时发现警告 

命令行打印:

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.

解决方法:在iOS9 beta1中,苹果将原http协议改成了https协议,使用 TLS1.2 SSL加密请求数据。 
在info.plist中添加

<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict>


8.出现错误: 添加友盟时发现错误:

命令行打印:

does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7

解决方法:由于Xcode自身的一些小问题,运行项目时一直报错 错误1的内容.然后我就检查项目友盟这个库的依赖呀.非常肯定的确认库已经导入而且在链接的二进制库里面.(就是build phases里面).然后就不断的重新导入clean了好多次还是不行.然后我就崩溃了.. 后来把Xcode重启再次运行真正的错误终于浮出水面(毕竟Xcode是beta版).就是错误2的内容.原来是友盟的二进制库不支持bitcode.而Xcode默认是要支持bitcode的,而且如果支持的话,其中所有的二进制库和framework都必须包含bitcode.


9. Unrecoginised selector sent to instance  ox6c11060   控制台报这个错误,表示对象调用了一个不能识别的方法。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值