- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSDictionary *item = items[[indexPath row]];
GeneralViewController *viewController = [[GeneralViewController alloc] initWithViewName:item[keyClassName] andTitle:item[keyItemName]];
[[self navigationController] pushViewController:viewController animated:NO];
}
@implementation GeneralViewController {
NSString *viewName;
}
- (id)initWithViewName:(NSString *)aViewName andTitle: (NSString *) title{
self = [super init];
if (self) {
viewName = aViewName;
[self.navigationItem setTitle:title];
}
return self;
}
- (void)loadView {
self.view = [[NSClassFromString(viewName) alloc]init];
}
@end