iOS
sotfware
这个作者很懒,什么都没留下…
展开
-
AutoReleasePool 学习笔记
1. In a reference-counted environment, an NSAutoreleasePool contains objects that have received autorelease message. When the pool drained, it sends release message to each of the objects.2. The A...原创 2012-11-14 18:49:07 · 80 阅读 · 0 评论 -
iOS 与 Armv6 Armv7 i386
[size=large][size=medium]Armv6 binaries are needed if you’re targeting iPhone3G (yes, they still exist, my co-worker uses one, can u believe it?);Armv7 binaries are desirable if you’re targeting...原创 2013-08-23 16:39:26 · 80 阅读 · 0 评论 -
Xcode如何打包ipa安装包
http://jingyan.baidu.com/article/ceb9fb10f4dffb8cad2ba03e.html关键步骤:1. 设置 debug 和 release 的证书2. scheme 中,build configuration 设置为 release3. 选择菜单栏中的"Product"->"Archive"...原创 2013-09-05 11:41:17 · 82 阅读 · 0 评论 -
Objective-C 中,@class & #import 的区别
Key points: "#Import" links the header file it contains. Everything in the header, including property definitions, method declarations and any imports in the header are made available. Import pro...原创 2013-09-29 10:38:27 · 72 阅读 · 0 评论 -
OC 和 C++ 混编
原文出处: http://blog.csdn.net/fengsh998/article/details/8010696个人要点总结: 在 Xcode 中,Compile Sources As 的默认选项为 According to File Type。不改变该设置的前提下,如果要在某个类中使用 C++ 代码,则必须把该类的后缀由 .m 改为 .mm....原创 2013-10-08 15:45:55 · 105 阅读 · 0 评论 -
创建 Empty Application时, storyboard 不显示的问题
原因: 1. 创建 Empty Application 时没有 Using Storyboard 选项,需要手动创建 MainStoryboard。 2. Changed Main Storyboard in Target's Summary view 3. For an Empty Application, the default implementa...原创 2013-10-15 09:49:17 · 104 阅读 · 0 评论 -
setValue:forUndefinedKey
使用 Storyboard 创建并管理 UI 时,在运行 app 的时候出现了 2013-10-15 09:21:03.212 TestMSR[610:11303] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this...原创 2013-10-15 09:54:48 · 166 阅读 · 0 评论 -
写文件,真机和模拟器是不一样的
在真机上,只能往 Documents 和 tmp 目录下写文件。因为文件夹Resouces是只读的,无法写入。document 和temp文件夹的东西才是可读写的。 在模拟器上没有这个限制。 血泪教训啊!...原创 2013-10-17 22:30:46 · 97 阅读 · 0 评论 -
怎么创建 UITableViewCell 的 xib
1. 新建文件,选择 User Interface->View-> MyCell, 生成 MyCell.xib2. 打开 MyCell.xib ,删除自带的 View3. 拖拽一个 Cell 到 该 xib 通过以上步骤就生成了根 view 为 UITableViewCell 的 xib 文件...原创 2014-10-27 13:08:30 · 111 阅读 · 0 评论 -
iOS 调试问题小结
1. XCode 提示 ”set a breakpoint in malloc_error_break to debug “时,如何设置 malloc_error_debug? solution: Step 1: Set a breakpoint on malloc_error_break() by opening the Breakpoint Navigator (Vie...原创 2014-06-12 11:17:04 · 208 阅读 · 0 评论 -
Could not launch " app name"
“could not launch app name”这个问题经常遇到,很讨厌。终于集齐了可以解决该问题的方法,要么一种方法即可以解决问题,要么这些方法得齐上阵。 1. 删除机器或模拟器上已经安装的该 app; 2. 删除 Derived Data: Shift+Command+2, 在 Projects 栏目下,右侧找到该工程,然后在左侧点击 Delete 按钮,...原创 2013-12-19 11:11:11 · 95 阅读 · 0 评论 -
HOW TO ADD PHOTOS TO THE IPHONE SIMULATOR
Building an app that needs to access the photo library but don’t have any photos in the iPhone simulator? No problem. Follow these simple steps to import photos into the iPhone Simulator:Open the iP...原创 2012-12-25 15:49:29 · 124 阅读 · 0 评论 -
iOS 查看各个函数的执行顺序
- (BOOL)respondsToSelector:(SEL)aSelector{ printf("selector------->:%s\n",[NSStringFromSelector(aSelector) UTF8String]); return [super respondsToSelector:aSelector];}原创 2013-01-04 16:10:22 · 417 阅读 · 0 评论 -
用 lipo 命令裁剪出需要的 architecture
[size=medium] iOS 上的 framework 和 .a 库一般会同时支持多个 architecture, 比如 i386, armv7, armv7s 等。 为了减小程序的尺寸,可能需要裁剪掉不需要的 architecture, 这时就需要使用 lipo 命令给程序瘦身。 Step1: 查看目标库文件支持的 architecture, 两个选择 ...原创 2013-11-06 15:23:08 · 302 阅读 · 0 评论 -
把 iOS app logs 写入 documents 文件夹
Now, in order to tell your app to redirect the NSLog() outputs to a file, you should do something like this:NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMas...原创 2013-12-06 17:15:03 · 238 阅读 · 0 评论 -
Difference: Category and Protocol
http://www.cnblogs.com/chijianqiang/archive/2012/06/22/objc-category-protocol.html原创 2013-07-14 16:45:29 · 66 阅读 · 0 评论 -
kAudioSessionIncompatibleCategory
A Note About kAudioSessionIncompatibleCategory Error on iOS 5 and 6There is bug apparent on both iOS 5 and 6 (but not iOS 7) that manifests in apps that use the PlayAndRecord audio session categor...原创 2013-12-13 10:30:18 · 67 阅读 · 0 评论 -
How to know whether a project uses ARC
There are 2 method to check whether a project is using ARC.1. Select the project, open Build Settings. Look for Objective-C Automatic Reference Counting in the Apple LLVM Compile - Language section....原创 2013-12-17 11:17:06 · 68 阅读 · 0 评论 -
Why iOS 5.x doesn't work under Maverick
The iOS simulator does not duplicate some of the low-level parts of iOS. For example, it uses the host OS X's kernel instead of trying to virtualize the iOS kernel. The iOS simulator requires that the...原创 2013-12-19 09:52:22 · 85 阅读 · 0 评论 -
Xcode 6 新建工程运行在 iOS 7 上下有黑边的问题
原因:Xcode 6 默认新建的启动页面为 LaunchScreen.xib,系统通过检测是否有这个文件,来判断 app 是否支持 iphone 6 & 6 plus. 如果要支持 iOS 7,还必须添加 Launch Image assets. 如果 app 要支持 iOS 7但是没有设置 Launch image assets ,在 iOS 7 上运行上下...原创 2014-11-02 10:01:00 · 149 阅读 · 0 评论