
常见错误处理
focusjava
这个作者很懒,什么都没留下…
展开
-
如何关闭浏览器的HSTS功能
在安装配置 SSL 证书时,可以使用一种能使数据传输更加安全的Web安全协议,即在服务器端上开启 HSTS (HTTP Strict Transport Security)。它告诉浏览器只能通过HTTPS访问,而绝对禁止HTTP方式。HTTP Strict Transport Security (HSTS) is an opt-in security enhancement that is s原创 2017-11-14 15:19:24 · 7217 阅读 · 0 评论 -
解决删除nsuserdefault全部内容后创建uiwebview挂机
在ios5.1中会出现的一个问题,令我很困扰,找了英文资料才知道原因.程序里先显示了一个web,然后清空NSUserDefault,再去打开uiwebview,出现如下的错误提示:-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: WebKitLocalStorageDatabasePathPre原创 2013-09-30 11:24:09 · 1238 阅读 · 0 评论 -
could not be opened. Could not read archive
The document "ViewController.xib" could not be opened. Could not read archive.Please use a newer version of Xcode. Consider changing the document's Development Target to preserve compatibility.Xco原创 2013-09-24 18:30:30 · 1677 阅读 · 0 评论 -
iOS解决两个静态库的冲突 duplicate symbol
场景:解决TencentOpenAPI.framework与ZbarSDK中 _base64_encode 函数的冲突后来在网络上搜寻,删除掉 Other Linker Flag 的 -all_load 就可以解决静态库冲突的问题,但是这样做的话,会使一些外部的静态库,使用objc扩展函数(catagory)的方法失效。例如BaiduMapApi如果是有些库使用到原创 2013-07-24 15:49:58 · 2069 阅读 · 0 评论 -
非Objc文件(c, c++)引起的NSObjCRuntime错误
今天在objc工程中,导入一些c、c++文件时,,编译引起了NSObjCRuntime错误,,,仔细检查发现,原来是在SK_Prefix.pch中,定义了1 #ifdef __OBJC__2 #import 3 #import 4 #endif5 6 #import "Utils.h"7 #import "Constants.原创 2013-07-24 13:30:53 · 1370 阅读 · 1 评论 -
如何用Xcode 4.5 编译支持 armv6 CPU及iOS 4.3以前的版本
原来的iPhone,iPhone3G 以及 第一代和第二代的iPod Touch 均只支持 Armv6的CPU指令集。然而,随着iPhone3GS 这款新产品的发布,Apple 开始支持新的指令集 Armv7,iPhone5的所有设备支持Armv7s,且向下兼容。为了保持向下兼容,且支持旧有设备及旧有指令集,Apple支持胖二进制代码(fat binaries)也就是在可执行文件中支持更多的平原创 2013-07-09 10:05:05 · 839 阅读 · 0 评论 -
Xcode 工程文件打开不出来, cannot be opened because the project file cannot be parsed.
svn更新代码后,打开xcode工程文件,会出现 xxx..xcodeproj cannot be opened because the project file cannot be parsed. 因为.xcodeproj工程文件冲突了,然后还是会强制更新,内部文件出现了冲突,所以解析不了文件。 会出现这样的冲突消息 [cpp]原创 2013-05-22 15:43:05 · 988 阅读 · 0 评论 -
UITableView为group时设置背景透明
当UITableView的样式为group时,在ios6中要设置其背景色为clear 需要设置tableview.backgroundView = nil;tableview.backgroundColor = [UIColorclearColor];这样就可以自定义整个背景了。原创 2013-05-10 16:59:39 · 1102 阅读 · 0 评论 -
duplicate symbol _OBJC_IVAR_$_CDataScanner.data ......... for architecture i386此错误解决方法
ld: duplicate symbol_OBJC_IVAR_$_CDataScanner.data in/Users/apple/Library/Developer/Xcode/DerivedData/ClothesTry-aikecqhjtelboafozutskstpysag/Build/Intermediates/ClothesTry.build/Debug-iphonesimulator原创 2013-05-07 17:06:24 · 1051 阅读 · 0 评论 -
UIImageView上面放UIButton不响应事件
UIImageView上面如果放UIButton,那么UIButton的按钮响应事件就不触发了。这时需要把UIImageView的userInterface打开原创 2013-04-28 20:46:46 · 1126 阅读 · 0 评论 -
unbalanced calls to begin/end appearance transitions for uiviewcontroller的解决方法
iOS5 UIViewController加入了管理UIViewController的功能,就像管理subview一样方便。这儿有一博文介绍得很清楚。我在项目中用到了它,方便view的切换。下面的代码有一种fade in/out的效果。[self transitionFromViewController:_currentVC toViewController:newVC duratio原创 2013-04-28 18:51:09 · 874 阅读 · 0 评论 -
Couldn't register com.lcworld.iphone4itouch with the bootstrap server.
Couldn't register com.lcworld.iphone4itouch with the bootstrap server. Error: unknown error code.This generally means that another instance of this process was already running or is hung in the de原创 2013-04-26 15:26:46 · 969 阅读 · 0 评论 -
error: failed to attach to process ID 0”
1. clean all.2. kill -9 xcode的PID( ps -A | grep code | grep psn可以拿到)3. kill -9 模拟器PID(上面那个命令也能拿到)4. 打开模拟器, 清除那个程序5. 打开xcode, 在模拟器上run.原创 2013-04-25 09:49:24 · 880 阅读 · 0 评论 -
真机测试及布署Code Sign error问题总结
Code Sign error: Certificate identity 'iPhone Developer: idf (XR9HN3TD7E)' appears more than once in the keychain. The codesign tool requires there only be one.原因是证书,下载安装重复了,找到安装证书的位置,删除一个就ok了。原创 2013-04-20 17:25:16 · 914 阅读 · 0 评论 -
Xcode 精简版僵尸变量 处理EXC_BAD_ACCESS
Xcode -> Product ->Scheme ->Edit Scheme1,Arguments -> Environment Varibles 添加 NSZombieEnabled 值为YES2,Diagnostics -> Enable Zoomble Objects 勾选上重启Xcode!OK程序崩溃时,控制台就会打印谁被deallo原创 2013-04-18 20:19:45 · 1461 阅读 · 0 评论 -
XCODE调试技巧收集
前记:编写代码过程中,出现错误、异常是不可避免的,这个时候,就体现了调试的重要性,下面就总结一下,平常我自己使用的一些调试技巧,以及汇总网络上其他网友使用的技巧。(ps以后有新的调试技巧,我也会一并更新)1、使用僵尸变量(NSZombieEnabled) 2、重写object的respondsToSelector方法在iphone开发的时候EXC_BAD_ACCESS这个bug时不容易原创 2013-04-18 20:00:39 · 762 阅读 · 0 评论 -
ios6.0中,UIAlertView不能在子线程中执行了
+(DisplayErrorMsg *)sharedDisplayErrorMsg{ static DisplayErrorMsg *instance = nil; @synchronized(instance) { if (instance == nil) { instance = [[DisplayErrorMsg原创 2013-04-17 18:54:44 · 1356 阅读 · 0 评论 -
Could not change executable permissions on the application
Could not change executable permissions on the application. 这个错误是因为 证书我们用了两次。就是说在真机上已经有了一个用了此证书的项目存在,只要把之前的项目从真机上删掉,这个项目就可以使用了。 主要是会在使用推送的时候遇到这个问题,因为推送需要去申请一个推送的证书,而这个证书只能同时存在于一个项目中(真机中)。正所谓一山原创 2013-04-17 18:31:30 · 555 阅读 · 0 评论 -
关于***-Prefix.pch has been modified since the precompiled header was built的错误
当从一台机器上把源码拷贝到另一台机器上时,出现了如下错误。fatal error: file'/Volumes/work/iosdev/LoveWeather/LoveWeather/LoveWeather-Prefix.pch' has beenmodified since the precompiled header was built 在网上没有找到合适的解决方法之后,自己试着做了如原创 2013-04-10 13:18:20 · 776 阅读 · 0 评论 -
EXC_BAD_ACCESS的错误定位
EXC_BAD_ACCESS的错误定位 1、iphone开发:EXC_BAD_ACCESS的错误导致crash,定位在main()函数中,通过输出日志来定位,但是耗时长。最好的方式是:在Arguments下输入环境变量(NSZombieEnabled, MallocStackLogging, MallocStackLoggingNoCompact),一原创 2013-04-08 17:06:14 · 1194 阅读 · 0 评论 -
Tried to obtain the web lock from a thread解决方法之一
项目中一个UIViewController内使用异步线程,异步线程未执行完时pop退出此画面,程序crash。控制台打出错误如下:Tried to obtain the web lock from a thread other than the main thread...经调查,发现是由于UIViewController的release方法没有在主线程中调用造成的cr原创 2013-04-08 16:46:46 · 821 阅读 · 0 评论 -
Could not instantiate class named NSLayoutConstraint
xcode 升级到了 4.5 之后 只要往xib上面拖放控件 就会报错,解决方法, 选中当前的 xib文件,在属性栏里面进行以下操作:再右边的 inspector 一栏 将 interface builder document 下的 use autolayout 复选框去掉就可以了原创 2013-04-08 10:07:38 · 677 阅读 · 0 评论 -
IOS开发真机调试 png图片问题
IOS开发真机调试 png图片问题问题:CopyPNGFile/Users/gongihou/Library/Developer/Xcode/DerivedData/KTVgo-frborfduejxrajgpkfdaipygijow/Build/Products/Debug-iphoneos/KTVgo.app/zhuangtai.pngKTVgo/zhuangtai.png cd原创 2013-03-31 14:13:10 · 906 阅读 · 0 评论 -
解决OBJC_CLASS_$_MBProgressHUD无法引用的问题
解决OBJC_CLASS_$_MBProgressHUD无法引用的问题Undefined symbols for architecture i386: "_OBJC_CLASS_$_MBProgressHUD", referenced from: objc-class-ref in ViewController.old: symb原创 2013-03-26 10:47:28 · 1660 阅读 · 0 评论 -
常见的内存泄露情况
1,一般来说,alloc都会应该对应一个release2,另外,对于autorelease的实例,不能再使用release了3,对于用类方法创建的实例,无需release,因为在传递过来时,已经被autorelease了4,对于成员变量,一般需要release,途径有两个:在alloc创建、使用完后,直接release;在dealloc方法中release。二者取其一。5,对于ni原创 2013-03-02 16:29:19 · 656 阅读 · 0 评论 -
Xcode不提示,不高亮 解决办法
Xcode方法提示显示的不正确,只显示方法名称不显示参数及参数值的解决办法是:右击“Finder” 选择 “前往文件夹” 输入“~/Library”,进入“Developer” -> "Xcode" ->"DerivedData",删除所有东西,重启Xcode。原创 2013-02-25 15:58:41 · 3175 阅读 · 0 评论