So, one issue I have run into often is trying to get data from a parent view in a child view.
For example, Consider I have a standard navigation drill down application, with RootViewController, View2Controller, and View3Controller. (i.e. Root Navigates to View2 which navigates to View3). In this example, if I am in View3, and I want to access "shared" data that was created in view2, then I need to either pass the value in when I display View3, or I have to create a global object in my AppDelegate class and then access it that way using the following code:
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
This is ok in some instances, but it would be much better if at times I can access properties of a parent view directly from the child view. I have been tinkering with this for a while now, and have yet to find an easy approach. Any ideas?
For example, Consider I have a standard navigation drill down application, with RootViewController, View2Controller, and View3Controller. (i.e. Root Navigates to View2 which navigates to View3). In this example, if I am in View3, and I want to access "shared" data that was created in view2, then I need to either pass the value in when I display View3, or I have to create a global object in my AppDelegate class and then access it that way using the following code:
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
This is ok in some instances, but it would be much better if at times I can access properties of a parent view directly from the child view. I have been tinkering with this for a while now, and have yet to find an easy approach. Any ideas?