我目前在我的UIButton類別中使用塊。不過我也碰到過這個錯誤,我解決不了:錯誤:/usr/include/objc/objc-class.h:沒有這樣的文件或目錄
error: /usr/include/objc/objc-class.h: No such file or directory
這是代碼,使用塊行:
FTButtonBlock block = objc_getAssociatedObject(self, "buttonBlock");
我目前在我的UIButton類別中使用塊。不過我也碰到過這個錯誤,我解決不了:錯誤:/usr/include/objc/objc-class.h:沒有這樣的文件或目錄
error: /usr/include/objc/objc-class.h: No such file or directory
這是代碼,使用塊行:
FTButtonBlock block = objc_getAssociatedObject(self, "buttonBlock");
變化
#import <objc/objc-class.h>
到
#import <objc/runtime.h>
替換當前符合以下行:
#import <objc/runtime.h>
感謝。
在xcode 4.6之後,這又一次崩潰了。我只是解決了這個問題是這樣的:
cd /usr/include/
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/objc .
現在,它就像一個魅力
@TheLearner:還有同樣的問題? – Jhaliya 2011-06-15 10:24:53
很高興發佈解決方案而不是鏈接。但那只是我的偏好。 – bentford 2011-11-01 17:34:54
tldr; 然後將溶液是改變此導入語句SHK.m: '#進口' 到: '#進口 USR /包含/ objc/objc -class.h>' 或(上的xcode 4.3.1): '#進口' –
ghostfly
2012-03-16 18:10:57