Releasing statically allocated nsarray
I have a s开发者_运维知识库tatic array in my class. When do i release it? or I don't have to worry about it? I was thinking about releasing it in dealloc method but not sure. Thanks
If it's static, you shouldn't release it.
If you are concerned about the amount of memory the array takes up (because it's potentially large and is something that you can always recreate if needed), you can empty the array upon receiving a didReceiveMemoryWarning notification. Otherwise there's really no reason to care too much about it.
精彩评论