we know that using category we can add functions to existing class. But i have a doubt that, Is it possible to add objects or data members to category in objective C ??
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.
You’re right, you cannot add instance variables / members / properties via a category. You can only work with what the class you’re expanding already offers, but of course your new methods may receive arguments upon being called.