Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-21-2010, 08:21 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 3
jaxmeier is on a distinguished road
Question UITableView as Grid

Hi All,

I am new to iPhone development and really enjoy it, though I have been programming with MS stuff for over 10 years. As such, I am having a hard time getting the hang of the UITableView, as I am far more fluent in using DataGrids.

What I would love to be able to do is have a master tableview, and when a record/cell is selected, pass the record ID instead of the displayed text to the detail tableview. Because my stored procs in my webservice already have lookups by ID and I am using normalized tables using ID values, I would prefer not to have to do the lookup based on the text of the record.

I already have an NSMutableArray of NSMutableDictionary items to populate the master tableview datasource with both the ID and data. I assume I would just need a custom tablecell with a hidden label or text field for the ID instead of just assigning the text to the cell.

If anyone has any alternative suggestions, I would love to hear them. I am loving this challenge and would like to continue, but the lack of a datagrid appears to me to be forcing some pretty bad habits from a developer/architect perspective...B-)

Thanks,
jax
jaxmeier is offline   Reply With Quote
Old 06-21-2010, 08:32 AM   #2 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 864
nobre84 is on a distinguished road
Default

You should be able to tell which data object you have at hand according to the cell's section/row and grab the ID from your data model, you don't need to store any data in the cell at all
nobre84 is offline   Reply With Quote
Old 06-21-2010, 08:34 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,549
RLScott is on a distinguished road
Default

I don't understand why you think that lookup based on the text of a record is needed or suggested. Cell display is based on index path (which includes row) and cell selection is also based on row. With the row number in hand, why would anybody think of looking things up based on text contents?

Robert Scott
Ypsilanti, Michigan
RLScott is offline   Reply With Quote
Old 06-21-2010, 08:59 AM   #4 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 3
jaxmeier is on a distinguished road
Default

Quote:
Originally Posted by nobre84 View Post
You should be able to tell which data object you have at hand according to the cell's section/row and grab the ID from your data model, you don't need to store any data in the cell at all
Now that I think about it, that makes more sense... I just got hung up in the MS datagrid model.

Thanks for setting my brain straight.

jax
jaxmeier is offline   Reply With Quote
Old 06-21-2010, 09:02 AM   #5 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 3
jaxmeier is on a distinguished road
Default

Quote:
Originally Posted by RLScott View Post
I don't understand why you think that lookup based on the text of a record is needed or suggested. Cell display is based on index path (which includes row) and cell selection is also based on row. With the row number in hand, why would anybody think of looking things up based on text contents?

Robert Scott
Ypsilanti, Michigan

Hi Robert

I need the unique ID corresponding to the data, not the row number. I got the response above and realized I can just use the dictionary based on the array index from the row index, then pass the ID from the dictionary to the detailviewcontroller.

Thanks for the reply though
jax
jaxmeier is offline   Reply With Quote
Reply

Bookmarks

Tags
detail, master, uitableview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 331
8 members and 323 guests
anothermine, Chickenrig, Domele, givensur, heshiming, michaelhansen, PixelInteractive, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:18 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0