Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // self.array is an array with controllers of difrent classes.
- // self array is initialized from a plist of NSStrings which contain the name of classes.
- // if the class name is from 2 words i want to know how can i init the correct nib name?
- // on the console i get the message: "Application tried to push a nil view controller on target"
- // how can i fix this?
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- NSLog(@"%@",self.array);
- NSString *name = [self.array objectAtIndex: [indexPath row]];
- if([name compare: @"Third Controller"] == YES)
- {
- id controller = [[NSClassFromString(name) alloc] initWithNibName: @"ThirdController" bundle: nil];
- [controller setTitle: name];
- [self.navigationController pushViewController: controller animated:YES];
- [controller release];
- return;
- }
- id controller = [[NSClassFromString(name) alloc] initWithNibName: name bundle: nil];
- [controller setTitle: name];
- [self.navigationController pushViewController: controller animated:YES];
- [controller release];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement