Get an ivar or property from a NSString

后端 未结 2 402
孤独总比滥情好
孤独总比滥情好 2021-01-19 15:26

Can we get an ivar or a property from a NSString like we can get a class from a NSString with the function <

相关标签:
2条回答
  • 2021-01-19 15:48

    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 讨论(0)
  • 2021-01-19 15:58

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

    0 讨论(0)
提交回复
热议问题