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.
user529758
source share