开发者

iPad detailedViewController displaying thumbnails

开发者 https://www.devze.com 2023-01-18 01:43 出处:网络
I am a newbie and I am developing an iPad application. I am developing an application that gives a list of cars in the Root View and when the user selects a car make, the t开发者_如何学Gohumbnail imag

I am a newbie and I am developing an iPad application. I am developing an application that gives a list of cars in the Root View and when the user selects a car make, the t开发者_如何学Gohumbnail images of the models are displayed in the detailed view controller. I was able to have a table but I am stuck as to how to display the thumbnails. I am able to display one picture per table row. Can anybody throw some light please?

Nik


Grab yourself a good iPhone book. If you're stuck with TableViews, you really should try to do some quick Xcode/iPhone reading. Then you can try again. Alternatively, you can do download the sample How to code from Apple's Developers site.

http://developer.apple.com/library/ios/navigation/index.html?section=Resource+Types&topic=Sample+C#section=Topics&topic=Data%20Management


The UISplitViewController has a RootViewController and the DetailViewController, when a you press a row this method gets called:

- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

You can see in the defult boilerplate code that it sets: the detailItem of the DetailViewController, this is a pointer (id) so it can be any object you want.

The setter for detailItem is this method located in the DetailViewController:

- (void)setDetailItem:(id)newDetailItem;

If you follow the flow, it then calls - (void)configureView;

In Your example i would recommend that your 'CarMake' object that your using to populate the RootViewController Cells also holds the path of the image that you want to display for it, then set this 'CarMake' object as the detailItem then in the configureView method, get the imagePath from the object (detailItem) and create the image with it and finally setting the .image property of an UIImageView to the created image.

Books are good, but nothing beats hands on breaking stuff!

0

精彩评论

暂无评论...
验证码 换一张
取 消