第一篇:Xcode 升级后,常常遇到的遇到的警告、错误,好程序员解决方法
,错误信息:
“_OBJC_CLASS_$ xxxxx ”, referenced from: objc-class-ref in ViewController.o ld: symbol(s)not found for architecture i386 clang: error: linker command failed with exit code 1(use-v to see invocation)解决方法:
查看工程,看是不是没有导入相关的框架。或者工程里添加的有相同“.m”,“.h” 文件
2,错误信息:
Couldn't register dy.CKRiLiText 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 debugger.Current language: auto;currently objective-c 解决方法: 可能是电脑内存问题引起,重启电脑即可解决。如果重启解决不了问题,那就是你刚刚改动的代码引起的问题。、错误信息:
ios 5是调试正常的,ios 6真机调试的时候,出现如下错误:ld: file is universal(3 slices)but does not contain a(n)armv7s slice: /Users/mac4/Desktop/my desktop/My app/MyApp name 20:09:12 /MyApp name/ZBarSDK/libzbar.a for architecture armv7serror: linker command failed with exit code 1(use-v to see invocation)解决方法:在Xcode里,点击相应的Target,然后点Build Settings,找到
,看里面的是不是arvm7s,如果不是改成arvm7s就可以了。、错误信息:
error: receiver type 'ViewController' for instance message does not declare a method with selector 'hideSearchBar:' [4] ViewController 中没有声明一个方法选择'hideSearchBar:
解决方法:
在ViewController.h 中声明一下这个方法 “ hideSearchBar ” 即可。
5、错误信息:当json从服务端请求时得到的字符串,如果这样写的话,会报错,';' after top level declarator
NSString *ss= @“{”recommend“:”世界末日“,”dogname“:”机器人“}”;解决方法:
就是,把 “
替换成 “ 即可。NSString *ss= @”{ “recommend ”: “世界末日 ”, “dogname ”:“机器人 ”}";、错误信息:
error: Existing instance variable '_datasource' for property 'datasource'
with assign
attribute
must
be __unsafe_unretained 解决方法:
id
architectures
to active
compile
for(ONLY_ACTIVE_ARCH=YES, VALID_ARCHS=i386).解决方法:
arch=x86_64, targets->build setting 下的 Build Active Architecture Only 设置 NO 即可.8.Jsonkit中的警告
Direct access to objective-c's isa is deprecated in favor of object_setClass()and object_getClass()object->isa 替换为 object_getClass(object)keyObject->isa 替换为 object_getClass(keyObject)(id)keys[idx]->isa 替换为 object_getClass((id)keys[idx])
format specifies type 'unsigned long' but the argument has type 'nsuinteger'(aka 'unsigned int')给变量增加(unsigned long)进行类型转换