Sukitha Udugamasooriya
Sukitha Udugamasooriya

Reputation: 2308

Best practice to use UIImages inside a UITableViewCell

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

Answers (1)

[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

Related Questions