一段不错的反照代码用来写tableView配置界面选中
一段不错的反射代码用来写tableView配置界面选中
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Class clazz = NSClassFromString([items_ objectAtIndex:indexPath.row]);
id viewController = [[clazz alloc] init];
if (viewController) {
[self.navigationController pushViewController:viewController animated:YES];
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Class clazz = NSClassFromString([items_ objectAtIndex:indexPath.row]);
id viewController = [[clazz alloc] init];
if (viewController) {
[self.navigationController pushViewController:viewController animated:YES];
}
}