Changing images in a UITableView with a plist

Опубликовано: 01 Октябрь 2024
на канале: MilmersXcode
6,882
20

n this tutorial you will learn how to make a custom UINavigationBarButton

Main Code:

In tableViewController.m - cellForRowAtIndexPath:
NSURL *url = [[[NSURL alloc] initWithString:[[[data objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] objectForKey:@"image"]] autorelease];
NSData *urlData = [[[NSData alloc] initWithContentsOfURL:url] autorelease];
[[cell imageView] setImage:[UIImage imageWithData:urlData]];

In detailViewController.m - viewDidLoad:

NSURL *url = [[[NSURL alloc] initWithString:petImageString] autorelease];
NSData *urlData = [[[NSData alloc] initWithContentsOfURL:url] autorelease];

petImage.image = [UIImage imageWithData:urlData];

Previous Video:    • iPhone Programming: Populating a UITa...  
Playlist:    • Setting iPhone Graphics  

Jan-marteen provided the graphics for this series;

Jan-marteens channel:    / jm11081996  
Jans video tutorial:    • Video  

My Twitter:   / failcakeapps  
Apple Developer Center: http://developer.apple.com/devcenter/...
My Website: http://failcake.webs.com/
My Channel:    / milmersxcode