ios开发中遇到的奇葩问题
2015-09-08 09:36
363 查看
1.假设imgList为一个0个object的数组对象
0<( imgList.count-1 )为真...
2.fatal error: 'XCTest/XCTest.h' file not found
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,有的话,删除一下即可。
比如说:在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。
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。
相关文章推荐
- iOS项目开发实战——获取本机IP地址
- iOS编写质量代码
- IOS开发小技巧
- IOS中NSFileHandle的基本用法
- iOS项目开发实战——弹出提示对话框
- [iOS翻译] Cocoa编码规范
- IOS时间与日期类的使用
- iOS项目开发实战——获取系统当前时间
- ios Crash闪退日志获取和上传至服务器(NSSetUncaughtExceptionHandler)
- iOS开发系列--音频播放、录音、视频播放、拍照、视频录制
- iOS-添加pch文件
- iOS:删除、插入、移动单元格
- iOS开发日记15-强制弹出系统键盘(禁用搜狗键盘)
- 加载网页——iOS学习连载28
- iOS 集成银联支付
- 【读书笔记】iOS-引用计数
- 【读书笔记】iOS-引用计数
- iOS远程推送之获取deviceToken
- IOS 开发技巧,小细节,注意事项
- iOS Cocoa编码规范