Take the 2-minute tour ×

If I want get one Label.text from View1, so I set in firstView.h

@interface RootViewController : UITableViewController {
 NSMutableArray *menuList;
@property(nonatomic,retain)NSMutableArray *menuList;


in secondView.h

@interface SecondViewController : UIViewController <UIPickerViewDelegate,UIPickerViewDataSource> {

 UILabel *comboView;

@property (nonatomic,retain)UILabel *comboView;

in secondView.m

[firstViewController.menuList addObject:comboView.text];

but when I want to get object from menuList in firstView(self.menuList) It become "null"!!!

What's the problem?? Thanks


share|improve this question
Mark your code as Sample code if you want some help. –  Alex Terente Jan 14 '11 at 10:38

1 Answer 1

up vote 1 down vote accepted

The code provided is very limited, did you remember to initialize the 'menuList' before adding objects? Objective C lets you add objects to uninitialized array's, so a mistake is easily made.

share|improve this answer
This is my guess as well. –  benwong Jan 15 '11 at 12:13

Your Answer


