mikeash / MAObjCRuntime

ObjC wrapper for ObjC runtime API
Other
1.53k stars 189 forks source link

Definition of 'Protocol' must be imported from module 'ObjectiveC.Protocol' before it is required #23

Open robertoandrade opened 8 years ago

robertoandrade commented 8 years ago

I get the following error when compiling a project that has this library as a dependency:

MAObjCRuntime/RTProtocol.m:79:13: Definition of 'Protocol' must be imported from module 'ObjectiveC.Protocol' before it is required

It seems to only happen with XCode 7.3, running 7.2 side by side compiles and runs just fine. Wondering if something changed in 7.3 or the compiler that causes these issues?

redent commented 8 years ago

Hit this issue when trying to compile after updating XCode. Any known workaround?

boscomonkey commented 8 years ago

I imported objc/Protocol.h at the top of RTProtocol.m and it now compiles.

#import <objc/Protocol.h>