1.靜態庫中包含了Category(分類)
如果靜態庫中包含了Category,有時候在使用靜態庫的工程中會報“方法找不到”的錯誤(unrecognized selector sent to instance)
解決方案:在使用靜態庫的工程中配置Other Linker Flags為-ObjC

2.IOS編譯報錯:objc-class-ref in AppDelegate.o之解決方案
|2015-01-23 09:50 |14695人閱讀
xcode6.0升級到xcode6.1后,程序編譯報錯,錯誤如下:這是個很常見的錯誤,很多項目在更換xcode版本后,都會出現類似的問題。

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_QQApiInterface", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_ShareSDK", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in RecipeDetailViewController.o
objc-class-ref in showViewController.o
objc-class-ref in video_show.o
"_OBJC_CLASS_$_TencentOAuth", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_WXApi", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_WeiboApi", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_YXApi", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解決方案:
Xcode升級到6.1.1 默認讓所有App都通過64位編譯器編譯。原來在Xcode6.0的時候默認的Architectures只有(arm7,armv7s),到6.1.1默認就帶上arm64的參數了。

把build active architectures only 改為 NO。
2. 把最下面的Valid Architectures中的arm64參數刪掉就可以了
或者:
雙擊Architectures,選擇other,刪除$(ARCH_STANDARD),然后增加armv7和armv7s(寫上:$(ARCHS_STANDARD_32_BIT))。
3.clean 再build。
結果設置如下圖:

目前設置完成后,問題順利解決,大家有更好的解決方案,歡迎討論!
