Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include non-ARC library in an ARC app?

So, is it possible?

I get this error multiple times:

ARC forbids Objective-C objects in structs or unions

For example here:

typedef struct {
    BOOL _field1;
    union {
        struct {
            id _field1;
            id _field2;
        } _field1;
        GSEventRef _field2;
    } _field2;
} XXStruct_CKAdxD;
like image 233
Tyilo Avatar asked Jan 23 '12 09:01

Tyilo


1 Answers

You need to add -fno-objc-arc to the compiler options for each file that doesn't / can't use ARC. Within Xcode you do this from the 'Compile Sources' build phase of your target. Double click the file and add -fno-objc-arc to the box that pops up.

like image 91
mattjgalloway Avatar answered Sep 22 '22 00:09

mattjgalloway