Hi,
I have a root view controller that I'm adding a subviewcontroller to.
Rootviewcontroller: I'm trying to add a value from a dictionary as the sole member of the moviewController.list
NSMutableArray
. However its not getting added and the NSlog is telling me that the "list: (null)
"
for (id key in dictionary) {
MovieController *movieController = [[MovieController alloc] initWithStyle:UITableViewStylePlain];
movieController.title = key;
[movieController.list addObject:[dictionary objectForKey:key]];
NSLog(@"list: %@",[movieController.list count]); //<<<<
[array addObject:movieController];
[movieController release];
}
in the subviewcontroller (MovieController) I create the list thats used to display the items in the table as:
- (void)viewDidLoad {
NSMutableArray *array = [[NSMutableArray alloc] init];
self.list = array;
[array release];
[super viewDidLoad];
}
Why is it that I can't addobject in the rootviewcontroller? The only way I can get the list to display in the MovieController is to initWithObjects
at the time of instantiation.
Regards
Sapatos