I declare a class extension interface adding vars to it. Is it possible to access those vars in a category of that class?
Share
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.
Sure – any variable is accessible through the runtime, even if it isn’t visible in the
@interface:SomeClass.h
SomeClass.m
SomeClass+Category.m
You can also use KVC to get iVars of classes in UIKit or similar, while being easier to use than pure runtime-hacking.