4

I'm using XCODE 4.2 on iOS5.

I have created a UITableViewController custom, called picker. This is the class content:

NSMutableArray *_nameCollection;
NSMutableArray *_imageCollection;

With 2 elements each. That works well. If I create programmatically a UITableview, it shows the data correctly.

On the view, I declare the class (inside (void)viewDidLoad):

self.Picker = [[Picker alloc] initWithStyle:UITableViewStylePlain];
_Picker.delegate = self;
PickerTableViewIB = _Picker.tableView;   // Try to link using a IBOutlet

PickerTableViewIB is an Outlet from a Tableview, created inside a subview, using Interface Builder.

What is missing?

Cœur
  • 37,241
  • 25
  • 195
  • 267
vgonisanz
  • 11,831
  • 13
  • 78
  • 130

1 Answers1

1

Are you setting the data source as well? You need that for the table view to get the data for populating. Otherwise the cellForRow method will not be called and your cells will not be populated.

_Picker.dataSource = self;

It would also be a good idea to call [self.Picker reloadData]; after setting the dataSource.

Igor N
  • 381
  • 2
  • 6