forum

Home / DeveloperSection / Forums / Convenience Vs init method (memory usage)

Convenience Vs init method (memory usage)

Anonymous User 1664 24-Oct-2015

I tried to create UIImageView object using Convenience and init method, after when I try to go back and check the memory usage that are increases after creation of both methods, the memory usage under the convenience method takes 10MB to 7MB and init method takes from 10MB to 4MB immediately both examples are here:
Convenience Method:

imageView.image = [UIImage imageWithData:[downloads dataAtIndex:0]];

init Method:

UIImage *aImage = [[UIImage alloc] initWithData:[downloads dataAtIndex:0]];
imageView.image = aImage;
[aImage release];

I also waited and interacted with the app to give time on releasing on the convenience method's autorelease. But it didn't drop much.
Other than the autorelease vs release, what else contributed the difference?


Updated on 25-Oct-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By