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 07-15-2011, 12:56 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 1
PowerTaco is on a distinguished road
Default UITableView with Unique label?

Hi!

I have just started using the iPhone SDK with just some basic knownledge in C++ from school.

Followed this guide that continues here - the whole project can with both guides included can be downloaded here.

My Question about the DetailView.

If a item is clicked it will show you the DetailView with no unique content.

I wonder if it is possible to show perhaps a picture with a UILabel/ScrollView or something when an item in the list is clicked? My coding skills isn't that great, but I am a fast learner! I would also like to have the text it in some sort of list..

Like this:

Clicks watermelon in the tableView ---> watermelon detailview:
_________________________________________

  1. This fruit is red and green.
  2. It taste funny.
  3. People like it alot.
  4. If it is broken, it cannot be repaired.
  5. Sweet juice.



_________________________________________



E.g - Every item in the list have unique DetailView with an unique text and a picture.

Could someone help me on the way?
Would really appreciate it!

Cheers from Sweden!
PowerTaco is offline   Reply With Quote
Old 07-15-2011, 01:12 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 459
NewiPhoneDeveloper is on a distinguished road
Default

Quote:
Originally Posted by PowerTaco View Post
Hi!

I have just started using the iPhone SDK with just some basic knownledge in C++ from school.

Followed this guide that continues here - the whole project can with both guides included can be downloaded here.

My Question about the DetailView.

If a item is clicked it will show you the DetailView with no unique content.

I wonder if it is possible to show perhaps a picture with a UILabel/ScrollView or something when an item in the list is clicked? My coding skills isn't that great, but I am a fast learner! I would also like to have the text it in some sort of list..

Like this:

Clicks watermelon in the tableView ---> watermelon detailview:
_________________________________________

  1. This fruit is red and green.
  2. It taste funny.
  3. People like it alot.
  4. If it is broken, it cannot be repaired.
  5. Sweet juice.



_________________________________________



E.g - Every item in the list have unique DetailView with an unique text and a picture.

Could someone help me on the way?
Would really appreciate it!

Cheers from Sweden!
Hi there,

what you're trying to accomplish is a rather simple task for a seasoned developer. However, as a beginner this is pretty much nightmare

Anyways, have you checked out Apple's Simple Drill Down sample code? I guess it will lead you into the right direction.
__________________
Websites:
Friendlydeveloper - Coding Blog
Codingsessions - Live iOS Training

iPhone Apps:
TextPal - Powerful group messaging,
icePhone

Find me on LinkedIn
NewiPhoneDeveloper is offline   Reply With Quote
Old 07-15-2011, 01:29 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

I'm sure there's multiple ways to get this done, and it all depends on where some of that data is coming from but a quick reference is that in any TableViewController you should have a section didSelectRowAtIndexPath. From that section you can setup a if statement to check what row was selected (if you know what each row is supposed to have) and then using that fill the labels in the Detail View with the information you want and then push the Detail View to come up. A lot of this depends on how you Populate your TableView and if there is a way for you to determine what value should be passed based on the Selected row, especially if your going to have more than a few rows. If you only have a few rows, the if statement would be easy (for instance if row==1 then add such and such data to Detail View and so on for each row). If you're going to have multiple rows then you may want to look into either assigning a tag value or something unique to each row (that isn't displayed) so when that value is passed to the DetailView the DetailView will load the appropriate data based on that value. Below is an example of the later since that's what I do for a large list of clients:

Code:
ClientDetailScreen *detailViewController = [[ClientDetailScreen alloc] initWithNibName:@"ClientDetailScreen" bundle:nil];
        NSString *selectedClientName = [[clientArray valueForKey:@"ClientName"] objectAtIndex:indexPath.row];
        NSString *selectedClientID = [[clientArray valueForKey:@"ClientID"] objectAtIndex:indexPath.row];
        detailViewController.receivedClientName = selectedClientName;
        detailViewController.receivedClientID = selectedClientID;
        [self.navigationController pushViewController:detailViewController animated:YES];
        [detailViewController release];
        detailViewController = nil;
In that example I pass a client name and client ID to the DetailView based on the row selected in the TableView. In my DetailView the ClientID is used to send a second request to my DB to fill in all the DetailView table information with the unique information for that client. This may be more complex than what you need, but should give you a basic idea of how it works.
mavrik5150 is offline   Reply With Quote
Reply

Bookmarks

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: 356
7 members and 349 guests
apatsufas, Kirkout, lzwasyc, MarkC, Sami Gh, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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