Reputation: 2308
If I'm loading images from the phone into a TableView about 50-60 entries, which method suits best?
[UIImage imageNamed:@"page02Background.png"];
OR
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"page02Background" ofType:@"png"]];
Upvotes: 1
Views: 160
Reputation: 25692
[UIImage imageNamed:@"page02Background.png"];
In my point of view tableviewcell is autorelease object. so first one is best.
if u have used many bundles and put images according to the bundle .then specifying the second one is best.
advantage of this second one is u may use same imagename with different bundle (if had same imagename but different photo in different bundle).
it depending upon ur needs u have to choose which is best suit for u.
Upvotes: 1