i can’t release objects after using it in objective-c i found error
release is unavailable
example ;
strokes *current = [strokesarray] objectAtIndex:0];
[current release]
last line is error why ?
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.
Your problem is this: since you have Automated Reference Counting (ARC) turned on in your project, you cannot call “
release” on objects.And even if you didn’t have ARC turned on, that code would not be correct because A), your brackets in “
[strokesarray] objectAtIndex:0]” aren’t balanced (syntax error) and B) releasing an object stored in an array means your app will crash with an EXEC_BAD_ACCESS error next time you attempt to access that object in the array.