Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cwolves

macrumors regular
Original poster
I have an object that is released in the middle of doing something. Specifically, it's an animation. When it changes to a frame, an event gets called via an NSNotification, and the subscriber sometimes releases the object.

The issue I'm running into is that after the object is released, control passes back to the object. It then calls [super render] which renders another frame of the animation.

If I check self at any point after the release, I get a type of "FREED(ID) *", with all the data still intact.

So my question is, is there a "correct" way of saying "only call [super render] if I still exist"?

btw "if(self){" doesn't work. 😀
 
I don't believe there is a method that you can send to a released object (which based on what i understand of your problem, would not exist anymore) to see if it exists. Either the object exists and it works, or it doesn't and you get an exec_bad_access. like eddietr, I'd take a look at your design and fix it up that way.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.