I'm trying to do a UITableView
, but I'm totally stuck. My problem is I'm trying to do the method -tableView:cellForRowAtIndexPath:
and for filling the cells I have a NSArray
of myObject
, which is set by another class via a setter in my UITableViewController
.
My problem is that when I'm going to use that array, it is totally empty, and I don't know why -- when I do the setter, the object has data, but when I try to do the getter inside the method above, it is empty. Can someone tell me why, and how can I fix it?
My setter:
- (void)setmyObjectList:(NSArray *)list{
_myObjectList = list;
}
MyObjectList is declared in the .h:
@property (nonatomic, strong) NSArray *myObjectList;
And this code is in the Controller that call my TableViewController via a segue:
myTableViewController *myTVC = segue.destinationViewController;
[myTVC setPharmaciesList:self.list];
Maybe I didn't explain well: I have a class that has a NSArray with the the objects I want to show in my TableView. So via a segue I set this NSArray in the TableViewController. In the setter when I do a NSLog all the data is in the NSArray in the property of the NSTableViewController, but when I try to access in the method tableView:cellForRowAtIndexPath: the info is empty. Why? I have no idea.
Thanks