Is there anyway to check if an object is alloced or not? Thanks.
Edit: Here’s a better question. Is it ok to alloc an object that was already alloced without changing it’s initial value?
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 may intend how to check if a pointer points to an allocated object (which, as long as it stays in memory, is referenced by an unique memory address). In that case you could test if that pointer is
nilin an if statement (or simply call is name in the condition, since objective-C inherits from C the evaluation of truth conditions, ie if it is not zero than it is true)