How do I retain classes that I write?
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.
First, ‘retain’ has a very specific meaning in Cocoa applications. It is used in pair with ‘release’ to augment the internal reference counter of an instance of NSObject (i.e. any class that inherits from NSObject). As such, one does not retain a class, but rather one retains an instance of that class. This is done as such:
For more information see:
http://www.otierney.net/objective-c.html#retain