Hey all,
I have an nsmutablearray declared in interface:
@interface UnitsDetailViewController : UITableViewController
{
NSMutableArray *units;
}
Then I try to add objects to it (and I verified that the objects exist via NSLog):
Yet the last NSLog above where I evaluate value of units, it returns null. I expect it to return an array of objects.
thanks for response
I have an nsmutablearray declared in interface:
@interface UnitsDetailViewController : UITableViewController
{
NSMutableArray *units;
}
Then I try to add objects to it (and I verified that the objects exist via NSLog):
Code:
NSLog(@"the units object contains %@", [unit objectForKey:@"id"]);
NSLog(@"the units object contains %@", [unit objectForKey:@"name"]);
Unit *model = [[Unit alloc] init];
model.unit_id = [unit objectForKey:@"id"];
model.name = [unit objectForKey:@"name"];
NSLog(@"the model property contains %@", model.unit_id);
NSLog(@"the model property contains %@", model.name);
NSLog(@"the model itself contains %@", model); //<Unit: 0x6bc6150>
[units addObject:model];
NSLog(@"the units object contains %@", units);
Yet the last NSLog above where I evaluate value of units, it returns null. I expect it to return an array of objects.
thanks for response