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

thomasjt

macrumors newbie
Original poster
Apr 16, 2009
23
0
Hello,

So, I suspect I need to read the memory management guide, and thankfully I have printed it out. And I shall read it in all its glory tomorrow. In the meantime though, can I ask something?

my AppDelegate creates a single object known as Game. Game then creates two objects; Data, and View, which do what their names imply.

In Games dealloc, it calls both [data release] and [view release]. Unfortunately, while data's dealloc method is getting called just fine, views dealloc method isn't. Moreover, if I then call [view release] a second time, I get a crash because view is already released!

How can view already be released if it's dealloc method isn't getting called? But then when called again the dealloc method works but crashes...?

Any help would be greatly appreciated.

Cheers,

Tom
 
Hello,



Any help would be greatly appreciated.

Cheers,

Tom

Hi there!

Is it possible to show the relevant code bits (alloc/retain/release/dealloc/etc) ?

Is this at the end of the program ? Because I seem to remember that not all deallocs are thebn guaranteed to be called.
 
Thanks for your offer of help ChOas but I think I've fixed it (for now).

Can I ask a question though?

In your dealloc method for a class you should release any class ivars, right? What about ones that are just created during a routine? Do you just need to release them at the end of the routine?

Cheers,

Tom
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.