Pass NSMutableArray between two UIViewController's

Posted by aahrens on Stack Overflow See other posts from Stack Overflow or by aahrens
Published on 2010-04-14T06:09:05Z Indexed on 2010/04/14 6:13 UTC
Read the original article Hit count: 420

I have two view controllers name RootViewController and SecondViewController. In the FirstViewController I have this NSMutableArray

@interface RootViewController : UITableViewController {

NSMutableArray *allClasses;}@property (nonatomic,retain) NSMutableArray *allClasses;

In the RootViewController I populate the UITableView with all the objects within allClasses

In my SecondViewController I have

@interface SecondViewController : UIViewController <UITextFieldDelegate,UIPickerViewDelegate> {

NSMutableArray *arrayStrings;}

I have a method that adds new NSStrings to the arrayStrings. My goal is to be able to pass the arrayStrings to the RootViewController by trying something similar to allClasses = arrayStrings. That way when the RootViewController is loaded it can populate with new information.

How would I got about accomplishing that task?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiviewcontroller