第一篇: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)解決方法:
查看工程,看是不是沒有導(dǎo)入相關(guān)的框架?;蛘吖こ汤锾砑拥挠邢嗤?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 解決方法: 可能是電腦內(nèi)存問題引起,重啟電腦即可解決。如果重啟解決不了問題,那就是你剛剛改動的代碼引起的問題。、錯誤信息:
ios 5是調(diào)試正常的,ios 6真機調(diào)試的時候,出現(xiàn)如下錯誤: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里,點擊相應(yīng)的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、錯誤信息:當(dāng)json從服務(wù)端請求時得到的字符串,如果這樣寫的話,會報錯,';' 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 設(shè)置 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)進行類型轉(zhuǎn)換