Custom icon in UITableViewCell

Added icons by the items to indicate the item category such as weapons, armors, items, etc.
API made it really easy to do this.


Inside this method in your UITableViewController:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

...put this:

UIImage *aIconImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"some_image" ofType:@"png"]];
cell.imageView.image = aIconImage;

No comments:

Post a Comment