类名和字符串之间的转换(实现动态编码)
类名转换成字符串
NSClassFromString(@"class")
字符串转换成类
NSStringFromClass([self class]);
实例
id VC = [[NSClassFromString([self.sourceArray objectAtIndex:indexPath.row]) alloc] init]; [self.navigationController pushViewController:VC animated:YES];