Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

iphone

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: No such file or directory

This is the line of code that uses blocks:

FTButtonBlock block = objc_getAssociatedObject(self, "buttonBlock");
like image 728
TheLearner Avatar asked Jun 14 '11 13:06

TheLearner


2 Answers

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

like image 133
Jhaliya - Praveen Sharma Avatar answered Nov 10 '22 06:11

Jhaliya - Praveen Sharma


Replace current line with following line:

#import <objc/runtime.h>

Thanks.

like image 27
Hemang Avatar answered Nov 10 '22 08:11

Hemang