十一、没法调试设备“Error launching remote program: failed to get the task forprocess 6405.”编程
ad-hoc Profile不支持调试。改成development profile。xcode
十二、OTA没法下载,提示“没法下载应用程序”架构
.plist文件中的 bundle-identifier写错了(或者包含中文字符),好比:异步
<key>bundle-identifier</key>ide
<string>com.xxx.--APN--</string>异步编程
其中的com.xxx.—APN—中包含中文(“--”),应改成英文。ui
或者签名证书是无效的。请在Orgnizer中检测签名证书。this
十二、ASIHTTPRequest中常常出现EXEC_BADspa
使用ASIHTTPRequest进行异步请求时,常常出现程序崩溃。尤为在是请求过程当中(未Finished),若是你切换了视图的时候。由于是异步请求,request对象可能在任什么时候候调用delegate(ViewController),而此时ViewController却可能已经释放了。由于UIKit随时会释放当前不显示的ViewController。若是你切换了ViewController,那么那个被隐藏的ViewController随时会被释放。若是request回调ViewController的delegate方法时,而那个ViewController正好被UIKit给释放,则会致使EXEC_BAD。在官方文档中也提到:Requests don’t retain their delegates, so if there’s a chance your delegatemay be deallocated while your request is running, it is vital that you clearthe request’s delegate properties. In most circumstances, if your delegate isgoing to be deallocated, you probably also want to cancel request, since you nolonger care about the request’s status线程
所以在使用ASIHTTPRequest进行异步编程时,咱们要本身清空request的delegate属性。在delegate(ViewController)的dealloc方法中你应该:
[request clearDelegatesAndCancel]; [request release];
固然,request不能是临时变量,而应当是一个retained的成员对象(或者属性),不然你没法在dealloc方法中clearDelegatesAndCancel。
1三、Assertion failure in -[UIActionSheet showInView:]
在主线程中打开action sheet:
[selfperformSelectorOnMainThread:@selector(showActionSheet) withObject:nilwaitUntilDone:NO];
showActionSheet方法:
-(void) showActionSheet
{ sheet = [[UIActionSheet alloc] initWithTitle:@"This is my ActionSheet!" delegate:self cancelButtonTitle:@"OK"destructiveButtonTitle:@"Delete Message!" otherButtonTitles:@"Option1", @"Option 2", @"Option 3", nil];
[sheet showInView:self.view];
}
1四、RegexKitLite编译错误
编译时提示以下错误:
"_uregex_find", referenced from: _rkl_search in RegexKitLite.o
……
在Build Settgins的Other Linke Flag中加入
-licucore
1五、Archive时遇到“ResourceRules.plist:cannot read resources”错误
在build settings中找到Code Signing Resource Rules Path,填入$(SDKROOT)/ResourceRules.plist
1六、使用ZombieEnable解决EXEC_BAD_EXCESS错误
这个错误是向一个release对象发送消息致使的。能够经过开启ZombieEnable参数来查找真正的问题。
Edit Scheme,选择Run …Debug,打开Arguments组,在Environment Variables中添加一个参数:
运行程序,当出现EXEC_BAD_EXCESS错误时,控制台中会输出具体出错的信息,好比:
*** -[ITSMTicketCell release]: message sent to deallocated instance0x897e920
直接指明了是因为某个对象在被释放以后,你发送了一条消息给它。
1七、 关于Xcode4没法调试2代代老设备的问题
升级到Xcode4之后,你会发现许多程序没法在2代设备(有些3代设备,好比iTouch 3实际上仍然是2代的硬件)上运行了,而且Xcode4仅仅“Running…”就直接“Finished…”了,不管是Xcode控制台仍是设备日志中,都没有任何提示。
注意:2代和3代的区别在于cpu架构。2代设备使用ARMv6架构cpu,3代设备使用ARMv7架构cpu。 iPhone 2G/3G,iPod 1G/2G属于ARMv6架构(2代),iPhone3GS/4, iPod 3G,iPad属于ARMv7架构(3代)。
stackoverflow上有关于这个的帖子,其中shapecatcher的答案是最准确的:
http://stackoverflow.com/questions/6378228/switching-from-xcode3-to-xcode4-cant-load-programs-onto-older-ipod-touch
一、打开Target的Build Settings,找到Architectures选项,将其从“$(ARCHS_STANDARD_32_BIT)”修改成“armv6$(ARCHS_STANDARD_32_BIT)”。注意大小写是敏感的。“$(ARCHS_STANDARD_32_BIT)”是一个变量,实际上等同于armv7。
二、Base SDK不须要改变,仍然是Lastest iOS。
三、打开Target的info,找到Required device capabilities,将下面的armv7删除。这个选项是Xcode4本身添加在工程中的默认设置,若是不去掉它,第1步-第2步的工做是没法生效的。
1八、“Avalid provisioning profile for this device was not found.”
在你的开发证书中增长该设备的UDID。
1九、将设备添加到 portal
链接设备,打开Orgnizer。在设备列表中选中设备,点击右边窗口左下角的“Add to Portal”按钮。或者在设备列的设备上右击,选择“AddDevice to Provisioning Portal”。
20、renew profile
打开Orgnizer,在LIBRARY中选择Provisioning Profiles。在右边窗口选择要renew的profile,点击右下角的“Refresh”按钮。输入Portal的密码,profile将被renew。
2一、renew签名证书及设备激活文档
从portal移除过时的签名证书
从新制做开发证书和发布证书
删除开发和部署所用的激活文档(provisioningprofiles)
使用新的证书从新制做用于开发和部署的Provisioningprofiles
从钥匙串中删除老的证书
在XcodeOrganizer中安装新的provisioning profiles
完成