您的位置:首页 > 其它

根据类的名字String生成相应的类

2016-06-15 18:53 281 查看
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

    NSString * className = cellDataArray[indexPath.row][@"className"];

    if ([className isEqualToString:@""]) {

        return;

    }

    Class classForCell = NSClassFromString(className);

//    NSLog(@"-----%@",className);

    id viewController = [[classForCell alloc] init];

    [self.navigationController pushViewController:viewController animated:NO];

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: