Do either or both of these date pointers requires a [release] when I’m done with them. How would i know this? I’m unsure since I’m not doing init explicitly.
NSDate *date = [NSDate date];
NSDate *date = [dateWithTimeIntervalSince1970:100000000];
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.
Both are autoreleased, that is you don’t need to release them yourself. The rule of thumb is that you own an object if you send +alloc or -copy or explicitly retain it:
If you own an object you must release it. +new is a shortcut to +alloc and -init.