ios5 xcode 4.2 中 release 顯示編譯警告或錯誤的解決方法
由于 iOS5 xcode4.2 引入了ARC (AutomicReferenceCounting) , 使用xcode4.2 新建項目時,會有一些小小的變化。
NSAutoReleasePool 被 @ {Autoreleasepool / / Code for autoreleasepool } block 取代了。
新增了__strong , __weak 編譯指令。
如果需要在項目中關閉 ARC 功能,在項目屬性中將CLANG_ENABLE_OBJC_ARC 設置為NO即可。否則在編譯時,會對 release ,retainCount, retain 等內存相關操作在編譯時出現紅色警告。
先不討論這arc這死人東西好不好. 去掉先, 不當小白鼠
posted on 2011-07-21 16:44 Khan 閱讀(2835) 評論(0) 編輯 收藏 引用 所屬分類: GCC/G++ 、跨平臺開發