Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
309 views
in Technique[技术] by (71.8m points)

ios5 - Files doesn't support the ARC feature, how to deal with

My project uses the ARC(Automatic Reference Counter), so when i try to import the ASIHTTPRequest library which has 4 classes that used in their implementation the autorelease statement, here is an example:

[self setAccessLock:[[[NSRecursiveLock alloc] init] autorelease]];

The error that i got:

ARC forbids explicit message send of autorelease

What should i do to solve this problem.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have got the solution, i needed to add the right flags to the compiler flags for each file which doesn't support the ARC. For me, i use Xcode 4.2, so under target -> Build Phases -> Compile Sources, double click on the file you want to disable the ARC feature and put -fno-objc-arc the click on Done. And it's Done ;)

Please note, that if the file doesn't exist on the list, you can just add it by clicking the + button and then perform the same work above.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...