I use initWithNibName to load detail views. I was just thinking do these things need to be released at all? init is basically adding a retain count of 1?
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.
@Mel:
Yes you need to release them.
A Part from Apple’s Doumentation:
You own any object you create
You create an object using a method whose name begins with “alloc”, “new”, “copy”, or “mutableCopy” (for example, alloc, newObject, or mutableCopy).
But as such it has nothing to do with
initWithNibNamebut it is related to four words which allocate the memory that is ‘mutableCopy’,’copy’, ‘retain’ and ‘alloc’. So hope it is clear to you now.initkeyword just initializes an object. Allocation of memory is done thoughallocorretainorcopyormutableCopykeywordAnd the retain count of 1 that you are talking about is because of the
allockeyword, not theinitWithNibName.Hope this helps you.