I want all the variables names or attributes of a interface or class in objective c.
I am able to get and set the value for a variable dynamically using valueForKey: message.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are looking to get all ‘properties’ for a class, you can utilize the Objective-C runtime to get this data:
With this object you can get all of the metadata associated with a given property. This isn’t for the faint of heart though (and it is a C based API). Determining information about each property (like it’s policy and type) isn’t simple.