I am working on an app that has a grouped table view. Each cell has an image, a title text, and a detail text that is stored in a plist. the plist also has the headers for the group headers and a view controller associated with that cell. I call the specified view controller to load the associated xib file for each cell selected. However most of the xibs have the same format ( an image, some text, and a play button to play some audio. there is also a button to flip the view. In this case I feel it would be wise to call on the same view controller to load the same nib but populate it with different variables associated with the cell selected. I have the variables included within the plist. but I am stymied as to how to write the code to have them displayed when the corresponding cell is selected. I have found an example that seems to do what I want by calling on the delegate however there are a few differences and I can't seem to get it to work. If anyone can give me some pointers, point me in the direction of a video tutorial of something I would really appreciate it.
here is the code I used to call the view controller to load the nib file and the code to load the image and text into the xib. from the plist depending on the cell selected.
- (void)tableView

UITableView *)tableView didSelectRowAtIndexPath

NSIndexPath *)indexPath {
const NSDictionary *const row = [self rowForIndexPath:indexPath];
TableViewPushAppDelegate *appDelegate = (TableViewPushAppDelegate *)[[UIApplication sharedApplication]delegate];
appDelegate.myImage= [[NSString alloc]initWithFormat:@"%@",[[tableDataSm objectAtIndex:indexPath.row]objectForKey:@"picture"]];
NSLog(@"%@", appDelegate.myImage);
appDelegate.textView = [[NSString alloc]initWithFormat:@"%@",[[tableDataSm objectAtIndex:indexPath.row]objectForKey:@"description"]];
NSString *wantedClassName = [row objectForKey:@"controller"];
UIViewController *const vc = [[NSClassFromString (wantedClassName) alloc] init];
NSLog(@"controller is -%@-", wantedClassName);
[self.navigationController pushViewController:vc animated:YES];
[vc release];
this is put in the view controller
@synthesize textViewTwo;
@synthesize imageOne;
-(id) init{
if((self = [super initWithNibName:@"Location One" bundle:nil])){
}
return self;
}
- (void)viewDidLoad {
NSLog(@"InView did load");
[super viewDidLoad];
TableViewPushAppDelegate *appDelegate = (TableViewPushAppDelegate *)[[UIApplication sharedApplication]delegate];
textViewTwo.text = [[NSString alloc] initWithFormat:@"%@", appDelegate.textView];
NSString *path = [[NSString alloc]initWithFormat:@"%@",appDelegate.myImage];
UIImage *img = [UIImage imageNamed

ath];
[imageOne setImage:img];
}
Thanks,
Gary