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 05-09-2011, 09:10 PM   #1 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default Pass data from DetailView to Tableview?

Is it possible to pass a float value from my detail view back to the table view? For example, I enter a amount into my detail view. I want to be able to get that value from the detail view back to the table view to display that value in my custom table view cell, which contains a uilabel. The table view is populated with an nsmutablearray, which is populated with custom objects. In these custom objects, I have a name and a float value. The name is not a problem because the user inputs the name in the tableview. However, like I said before the float value is input from the detail view. How would I go about grabbing this float value from the detail view? Thanks for any help.
Whitehk is offline   Reply With Quote
Old 05-09-2011, 10:06 PM   #2 (permalink)
Registered Member
 
Join Date: Mar 2011
Location: St. Louis, MO USA
Posts: 9
Hanoah is on a distinguished road
Default

Quote:
Originally Posted by Whitehk View Post
Is it possible to pass a float value from my detail view back to the table view? For example, I enter a amount into my detail view. I want to be able to get that value from the detail view back to the table view to display that value in my custom table view cell, which contains a uilabel. The table view is populated with an nsmutablearray, which is populated with custom objects. In these custom objects, I have a name and a float value. The name is not a problem because the user inputs the name in the tableview. However, like I said before the float value is input from the detail view. How would I go about grabbing this float value from the detail view? Thanks for any help.
Yes it's possible, same as passing data between any two views. Check this out for help.
__________________
The App Code Blog
Hanoah is offline   Reply With Quote
Old 05-09-2011, 10:15 PM   #3 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default

Quote:
Originally Posted by Hanoah View Post
Yes it's possible, same as passing data between any two views. Check this out for help.
How am I supposed to know which index I'm editing though? This is the part that really puts me at a stand still. Oh and I forgot to mention: I don't have a set amount of rows or cells in the table view. The user can add and delete rows to their liking.

Last edited by Whitehk; 05-09-2011 at 10:20 PM. Reason: Forgot to mention something
Whitehk is offline   Reply With Quote
Old 05-10-2011, 04:37 AM   #4 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

you pass a reference to your customObject to detailView, so that he can edit that....and when you return to tableview you have the new value on it.
__________________
dany_dev is offline   Reply With Quote
Old 05-10-2011, 07:36 AM   #5 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
you pass a reference to your customObject to detailView, so that he can edit that....and when you return to tableview you have the new value on it.
How would I do this without allocating a completely new instance of my custom object?
Whitehk is offline   Reply With Quote
Old 05-10-2011, 05:14 PM   #6 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Code:
YourViewController *myVc = [[YourViewController alloc] initWithCustomObject:customObject];
in this case you need to create a initWithCustomObject method

Code:
YourViewController *myVc = [[YourViewController alloc] init];
myVc.customObject = myCustomObject;
in this case you need to create a property.
__________________
dany_dev is offline   Reply With Quote
Reply

Bookmarks

Tags
detailview, nsmutablearray, passing data, uitabelview

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: 349
8 members and 341 guests
iOS.Lover, lorrettaui53, MikaelBartlett, oztemel, pbart, PlutoPrime, thephotographer, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

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