-2

Possible Duplicate:
iPhone: How to Pass Data Between Several Viewcontrollers in a Tabbar App

I have a "progress view" in one view and it is either at .60, .40 or .30, depending on what a user inputs. If the user goes to the next view, I want the progress view to be the same value that it was in the last view.

I searched the internet but with no luck I tried everything I could find on the internet and everything I could think of. Any ideas?

Community
  • 1
  • 1
Philip2905
  • 1
  • 1
  • 4
  • possible duplicate of [iPhone: How to Pass Data Between Several Viewcontrollers in a Tabbar App](http://stackoverflow.com/questions/2363777/iphone-how-to-pass-data-between-several-viewcontrollers-in-a-tabbar-app) also [How to pass data between different UIViewControllers](http://stackoverflow.com/questions/5272986/how-to-pass-data-between-different-uiviewcontrollers) – jscs Jul 09 '12 at 23:14
  • You asked the exact same question here ... – pasawaya Jul 10 '12 at 01:03

2 Answers2

0

A view controller is an object. So, first, you create one. That gives you a reference to the new view controller. You can then send the controller messages using that reference:

MyViewController *myVC = [[MyViewController alloc] initWithNibName:nil bundle:nil];
[myVC setSomeData:someData];

If you want more than that, you're going to have to edit your question to be more specific.

Caleb
  • 124,013
  • 19
  • 183
  • 272
0

When you write a subclass in Objective-C, you can add properties to the new class that can be accessed and written to by the parent controller (the class that instantiated the custom subclass). I suggest you look into how properties in Objective-C work; they're actually very simple. I can provide a simple example if you like. Let me know.

TeaPow
  • 687
  • 8
  • 17
  • I edited my question this might let you know some more and I would love to an example because I'm new to Objective-c – Philip2905 Jul 09 '12 at 23:23