Monday, April 30, 2012

Populate UITableView with custom objects?

I am unsuccessfully trying to populate a UITable from a NSMutableArray that contains a custom object.



My Student object



Student {
NSString name,
int age
}


In UITableView there is a method that displays the row's content:



cellForRowAtIndexPath
{
// there is more code here
cell.textLabel.text = [tableData objectAtIndex:indexPath.row];
}


Should my Student class implement a method that returns a String representation of the object? And then how can I display the content of the NSMutableArray in the UITableView.



Any help will be appreciated.





No comments:

Post a Comment