I'm currently developing a simple iPhone application using a UITabBar and table views for displaying data. The tabbar contains 8 sections, each containing the same view but using a different data source, the title of the table view is also different, but apart from that the views are the same.
I'd like to use the same viewcontroller for each view, with options to set the datasource and table title, instead of writing 8 separate viewcontrollers with minimal differences. Would that be possible and, more importantly, how would this be possible?
Update
I have it working to a certain extent, using the code posted by Ole Begemann. However, I realised that my initial question mixed up some jargon. UITableViewDataSource is an official protocol and does too much for what I'm trying to accomplish. I only need the logic to set up tables once, the data to populate the table view is the only thing that's different. What I meant by "datasource" was just an dictionary of objects which could be used by my the UITableView functions of my viewcontroller.
NSDictionary *row1 = [[NSDictionary alloc] initWithObjectsAndKeys:@"1", @"Id",
@"The Name", @"Name",
@"Post", @"Type",
@"09-09-2009", @"Meta",
@"This is the excerpt, @"Excerpt",
@"This is the body text", @"Body",
@"icon.jpg", @"Icon",
@"image.jpg", @"Image", nil];
NSArray *array = [[NSArray alloc] initWithObjects:row1, nil];
How can I pass this dictionary from the delegate to the UITableViewController?