Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to return objects from function in ARC?

Without ARC I can use autorelease for the Array as shown below

//-(NSMutableArray *)getObjects 

-(NSMutableArray *)retrieveObjects
{
    NSMutableArray *aArray = [[NSMutableArray alloc] init];
   // add objects
   return [aArray autorelease];
}

How to achieve the same in ARC?

like image 779
Ram Avatar asked Jan 21 '26 18:01

Ram


1 Answers

You don't autorelease the object.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!