Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获取由其字符串名称返回的 viewController?大意是:
NSViewController *foo = [ViewControllerByStringName:@"someCustomController"];
谢谢
阿德里安
NSClassFromString()你会想要的。例如:
NSClassFromString()
NSString *className = "MyClass"; id object = [[NSClassFromString(className) alloc] init];