Hi there,
I'm trying to code a navigation app using table views to give a list of names and when the persons table cell is selected it brings up a nib for that person.
So far I've been able to create the tables, populate it with data from an array and get when a cell is selected to change the view to a different nib. what I want to do is be able to navigate to a different nib file based on the cell selected.
My root view controller code is
The Cell Textlabel is pulled from the filmmakers array and the subtitle is pulled from the role array.
The code I'm using in the rootviewcontroller.m specific to changing the view is
What I would like to do is be able to have the initWithNibName pull from the niba array based on cell selection so instead of "JenViewController" it would insert "PeterViewController" if the Peter cell was selected.
Any help would be appreciated.
Thanks!!
Stuart
I'm trying to code a navigation app using table views to give a list of names and when the persons table cell is selected it brings up a nib for that person.
So far I've been able to create the tables, populate it with data from an array and get when a cell is selected to change the view to a different nib. what I want to do is be able to navigate to a different nib file based on the cell selected.
My root view controller code is
Code:
#import <UIKit/UIKit.h>
@interface RootViewController : UITableViewController
<UITableViewDataSource, UITableViewDelegate>
{
NSArray *filmmakers;
NSArray *role;
NSArray *niba;
}
@property (nonatomic, retain) IBOutlet NSMutableArray *nibx;
@end
The Cell Textlabel is pulled from the filmmakers array and the subtitle is pulled from the role array.
The code I'm using in the rootviewcontroller.m specific to changing the view is
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
anotherViewController *filmmakerViewController = [[anotherViewController alloc] initWithNibName:@"JenViewController" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:filmmakerViewController animated:YES];
[filmmakerViewController release];
Any help would be appreciated.
Thanks!!
Stuart
Last edited by a moderator: