error: /usr/include/objc/objc-class.h: No such file or directory

后端 未结 3 1916
悲&欢浪女
悲&欢浪女 2021-01-31 17:25

I am currently using blocks in my UIButton category. However I have come across this error which I cannot solve:

error: /usr/include/objc/objc-class.h:

相关标签:
3条回答
  • 2021-01-31 17:51

    Change

    #import <objc/objc-class.h>
    

    to

    #import <objc/runtime.h>
    

    From the blog entry: error: objc/objc-class.h: No such file or directory

    0 讨论(0)
  • 2021-01-31 18:16

    Replace current line with following line:

    #import <objc/runtime.h>
    

    Thanks.

    0 讨论(0)
  • 2021-01-31 18:16

    After xcode 4.6 this breaks again. I just fixed this like this :

    cd /usr/include/
    sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/objc .
    

    Now it works like a charm

    0 讨论(0)
提交回复
热议问题