views:

48

answers:

1

Hi all,

I'm confused about how to implement a specific piece of an app. The data is being collected in a Grouped Table, but certain rows drill down to another screen to allow the user to choose something. So for example, I would have Name: Surname: Age:

How do I get this Age value back to the first view when the user taps done ?

I am creating a Person core-data entity when the user saves the first screen that persists all of this data, but that doesn't exist when the user navigates to the second view. It cannot exist as Name and Surname are required fields, so I cannot save the core-data entity unless these already exist.

Is there any way for a view to return a data type to an earlier view in the navigation tree ?

Thanks in advance,

+2  A: 

First option:
pass it as a parameter in a custom init method

Second option:
Declare your CoreData variables in your AppDelegate and access in your views by using

NSManagedObjectContext *context = [(MyAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
Henrik P. Hessel
Looks like the first option there is the one I want. Enabling the managed object context still poses other problems, but option 1 looks good - thanks :)
Anonymouslemming
Anonymouslemming: If this answer worked for you, you should bestow the Checkmark of Acceptance upon it.
Peter Hosey
Ahhhh - I was wondering how you were supposed to approve things :) I'm more of a text based person than a visual one and I looked everywhere for an 'accept answer' link / button.
Anonymouslemming