tags:

views:

30

answers:

2

What's the best way to create a table view with thumbnails (like the iPhone Photos app)?

The problem I have is the selection part. How do I get information about the selected thumbnail of a selected row? A delegate method like:

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath atPoint:(CGPoint)touchedPointInCell

...would have made it easy. But how do I do this when I don't get the x or column of a table view selection?

Thanks in advance,

/ Påhl

A: 

i would use UIScrollView

GameBit
If I recall correctly, Apple is using a table view in the Photos app and in many other apps as well. I want to use a table view to minimize memory use by only allocating views for the visible thumbnails.
Påhl Melin
in wwdc examles they using UIScrollView for scroll like in photo app
GameBit
Thanks for the reference to the wwdc session (104 - Designing Apps with Scroll Views). I did't go that session this year, but I just watched the video. It's a very good session with sample code to do a slide show of images and I would also use a UIScrollView for that. But my "problem" was the thumbnail view where you select the image to view in the slide show. I will try using tagged UIButton:s in the cell as vodkhang and Suriya suggested. I'm still not sure if Apple is using UITableView or UIScrollView in the tumbnail view of the Photos app. Both would work but UITableView seems easier.
Påhl Melin
A: 

Instead of views use the buttons so that you can get its click event. And give some unique tag to each of the button so that you can get which button os clicked.

Based on that do whatever you want...

hAPPY cODING...

Suriya
Thanks I will try that. Tagging the buttons in the tableView:cellForRowAtIndexPath: delegate method and checking the tag in the click event of the button.
Påhl Melin
wlcm.. Getting a vote is the best thanks :P
Suriya