How to convert an ARC project to Non-ARC?

As far as I know, I know that we use the -fno-objc-arc flag to disable ARC for files that DO NOT support ARC in an ARC project.

We can also use the -fobjc-arc flag to enable ARC support for ARC files in a project other than ARC.

But if I want to convert an ARC project (not a specific file) into a non-ARC project, then how can I go further for the same?

Someone please tell me about this.

Thanks at Advance.

+7
source share
3 answers

You need to insert manual memory management methods in the appropriate places. In the general case, each call to new , alloc , retain , copy and mutableCopy should be balanced with release or autorelease (the latter is mainly used for return values), for example, the following code with ARC support:

 MyClass *myObj = [[MyClass alloc] init]; [myObj doStuff]; OtherClass *otherObj = [[OtherClass alloc] init]; return otherObj; 

there should be something like this in MRC:

 MyClass *myObj = [[MyClass alloc] init]; [myObj doStuff]; [myObj release]; OtherClass *otherObj = [[OtherClass alloc] init]; return [otherObj autorelease]; 

Read more about memory management in the official documentation.

+4
source

you need to complete this step

  • go to your project goals - search - Objective-C Automatic Checkout Counter

  • Set NO from YES

Enjoy Progaramming!

+18
source

enter image description here

very easy way to edit -> hidden -> to Objective-C ARC

+1
source

All Articles