开发者

How to get class object by NSString

开发者 https://www.devze.com 2023-03-09 19:05 出处:网络
We could use [NSObject class] to get class object, but forgot how to get class object by string, somethi开发者_运维问答ng like [OBJ getClassByNSString: @\"NSString\"]?

We could use [NSObject class] to get class object, but forgot how to get class object by string, somethi开发者_运维问答ng like [OBJ getClassByNSString: @"NSString"]?

Thanks.


Class myClass = NSClassFromString(@"ClassName");

0

精彩评论

暂无评论...
验证码 换一张
取 消