开发者

Get an ivar or property from a NSString

Can we get an iva开发者_开发技巧r or a property from a NSString like we can get a class from a NSString with the function NSClassFromNSString() ?


For any properties you can just use [object valueForKey:myString] and it'll be done. This can also find ivars in certain situations.


There are a number of functions in the Objective-C Runtime that let you get the list of ivars, properties, and methods associated with a given class, and then to get information about individual ivars, properties, and methods. Take a look at the Objective-C Runtime Reference.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜