类名转换成字符串
NSClassFromString(@"class")
字符串转换成类
NSStringFromClass([self class]);
实例
id VC = [[NSClassFromString([self.sourceArray objectAtIndex:indexPath.row]) alloc] init]; [self.navigationController pushViewController:VC animated:YES];
时间: 2024-11-13 11:24:01