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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 02-09-2009, 07:25 AM   #1 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 4
Default Requesting assistance with Application Development

First let me apologize for having to bother you with this request for assistance. I am normally resilient enough to figure things out for myself, but I am stuck, partially due to me being new to iPhone development (and the Mac).

Here is the problem;

I am creating an application that has a NavController, a TableView, a SearchBar, NS Dictionary, NS MutableDictionary and NS Mutable Array. The current flow of the app, includes loading of the app, list being populated, the list being searchable and segmented. I have no problems searching or selecting a row and "navigating" to a new view (xib). Here in the lies the problem.

In the new xib I wish to display a picture, text and a play button for some animation (.mov) file. I have the content of this xib file built, the image displays (using UIIMageView - but is static the image is defined in IB), a text field displayed using a UITextView (that is populated with a textView.text = statement in the viewDidLoad controller of the new xib) and a IBaction and associated button to play the video, with a video identified.

The problem, how do I associate the didSelectRowatIndexPath contained in the "table"-viewController with the content that is displayed in the new xib file ("content" - viewController).- e.g. I select row (3,4) and an associated image, text and video is displayed in the xib (view).

If you are kind of enough to respond, please keep in mind that I am newbie to programming and phrase your responses accordingly. If there is a thread that already addresses this topic please inform let me know the location.

Thanks
Dave
dhaase is offline   Reply With Quote
Old 02-10-2009, 10:24 AM   #2 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 4
Default What is the trick to getting a response.

I am new to using posts when requesting help. What is the trick to getting some assistance/response? Did I not word my request appropriately or include enough information. Do I need to add a "bribe" of a six pack of your favorite beer if you assist me in solving the problem .

Any assistance would greatly be appreciated.

Thanks
Dave
dhaase is offline   Reply With Quote
Old 02-10-2009, 10:45 AM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 495
Default

I don't use IB at all, so I can't help you with that aspect of it. However in general, you would likely have your array storing custom NSObjects that represent the encapsulated data for a single item in your table ( like image, movie, etc ).

Just like you use that to display the information in the cell, you'd also reference that in the didSelectRowAtIndexPath and then assign it to the new view by setting properties in the newly created view that is pushed onto the stack ( or through a convenience method that will let you just pass the object and it sets all the stuff it needs to ).

Something like this:
Code:
MyAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
MyObject *obj = (MyObject *)[delegate.dataArray objectAtIndex:indexPath.row];

NewController *controller = [[New Controller alloc] init];
[controller setDataWithObject:obj];
[self.navigationController pushViewController:controller animated:YES ];
[controller release];
That would be provided that you declare a method called setDataWithObject on your "NewController" class that takes in that data object.
__________________
My Apps on AppStore : gScale (guitar scales reference), eMaze, eMaze Lite, eTimesheet
exorcyze is offline   Reply With Quote
Old 02-10-2009, 10:55 AM   #4 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 4
Default Thanks

Thanks for the quick response. I will try and decipher the info you sent. I think I have an idea with what you are saying in relation to the code. I hate being in a newbie status ...."life is so much easier when you don't challenge yourself, but then it wouldn't be much of a life".

Dave
dhaase is offline   Reply With Quote
Old 02-10-2009, 11:30 AM   #5 (permalink)
Don
Registered Member
 
Join Date: Jan 2009
Posts: 67
Default

Dave ---

The "SimpleDrillDown" sample app demonstrates creating and using a "DataController" class to pass an object (in this case, a Dictionary) to your content view.

Sounds like it would fit your needs.

- Don
Don is offline   Reply With Quote
Old 02-10-2009, 11:44 AM   #6 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 4
Default Thanks

Thanks, I will definitely take a look at that.

Dave
dhaase is offline   Reply With Quote
Old 02-10-2009, 03:40 PM   #7 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 47
Default

yeah, it's simply and array of objects in the TableView and you pass an object to your details view in the didSelectRowatIndexPath method
chevoldavis is offline   Reply With Quote
Old 02-18-2009, 10:07 PM   #8 (permalink)
Registered Member
 
krye's Avatar
 
Join Date: Jan 2009
Location: NY, USA
Posts: 357
Default

I'm working on a similar problem. My object contains a name, a description, and an image. I would like to load an image into a UIImageView based on what was selected in the table row from the previous view. How do I load that? I can get everything to display, but the image. The name of the row appears in the nav bar, the description appears in the UILabel, but the image does not appear in the UIImageView.

The array entries look like this:
Fruit *fruit1 = [[Fruit alloc] initWithName:@"banana" description:@"This is a banana" picture:@"banana.png"];


My view is populated like this:

[self.navigationController pushViewController:self.fruitView animated:YES];
//put fruit name in the nav bar
self.fruitView.title = [fruit name];

//put fruit description into the label on the view
[self.fruitView.fruitDescription setText:[fruit description]];

I tried all these and nothing works:
//put the image into the UIImageView
[self.fruitView setImage:[fruit picture]];
self.fruitView.picture = [fruit picture];
[self.fruitView.picture setImage:[fruit picture]];
self.fruitView.image = [fruit picture];

Please help. Thanks.
krye is offline   Reply With Quote
Reply

Bookmarks

Tags
didselectrow, nsdictionary, uiimageview, uinavigationcontroller, uitextview

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: 234
17 members and 217 guests
ADY, AragornSG, Dani77, Dattee, Duncan C, fkmtc, HDshot, HemiMG, mer10, prchn4christ, Promo Dispenser, Punkjumper, Rudy, sacha1996, sneaky, spiderguy84, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,231
Posts: 380,768
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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