ios开发中遇到的奇葩问题

1.假设imgList为一个0个object的数组对象

   0<( imgList.count-1 )为真...

  

2.fatal error: 'XCTest/XCTest.h' file not found

解决方法:
在报错的Target中的Building settings中FRAMEWORK_SEARCH_PATHS添加$(PLATFORM_DIR)/Developer/Library/Frameworks

3.又是一个来自XCTest的坑爹问题:

dyld: Library not loaded: @rpath/XCTest.framework/XCTest   Referenced from: /private/var/mobile/Containers/Bundle/Application/3A8F980D-F647-4D6D-B95A-88EC600BCA6B/RR.app/RR   Reason: image not found

  

解决办法:工程-》targets-》Bulid Phases-》complie Sources-》搜索一下是否有test,有的话,删除一下即可。
 
4.viewController退出时不运行dealloc

解决方法:可能是...setTarget:self...的对象没有对self release。(setTarget时把self retain了)

比如说:在nstimer重复执行时,想要在退出时invalidate,要在viewWillDisappear中执行,而不能在dealloc中执行,因为self的retain count此时为1。在viewWillDisappear中invalidate之后,dealloc也可以顺利执行了。

5.CocoaPod运行问题
运行pod install时,提示An error occurred while processing the post-install hook of the Podfile.undefined method `project` for #<Pod::Installer:0x007ffa309af2e0>
处理方法:
打开Podfile,把里面的 project 改为 pods_project

6.自定义UITabBar的item的title无法改变颜色

使用:[self.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blueColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];无法改变item的title颜色

必须使用:[[UITabBarItem appearance]setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blueColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];

关键是:UITabBarItem appearance


7.状态栏以及整个界面所有元素变大的问题

出现这个问题的原因是没设置系统启动图。必须为app添加系统默认启动图才可恢复正常size。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值