Lars Schneider
Lars Schneider

Reputation: 5692

Can I create a ARC subclass of a non-ARC class

I want to subclass a class called "ASIFormDataRequest" which is in my project target with the compiler flag "-fno-objc-arc". Can I create a subclass of that class that uses ARC without problems?

Xcode does not throw any error if I do it. Any thoughts?

Thanks, Lars

Upvotes: 4

Views: 235

Answers (1)

Ole Begemann
Ole Begemann

Reputation: 135578

It shouldn't be a problem. The way to think about ARC is that there is no difference between an ARC and non-ARC file once it has been compiled (because all the compiler does is input retain, release and autorelease calls at the appropriate places). And since every file gets compiled separately before they are linked together, the resulting compiled code will just be the same (leaving aside certain optimizations the compiler can do when it deals with ARC code throughout).

Upvotes: 6

Related Questions