Re: Trying to understand -- please help...
Re: Trying to understand -- please help...
- Subject: Re: Trying to understand -- please help...
- From: Uli Kusterer <email@hidden>
- Date: Wed, 21 May 2008 22:33:49 +0200
Am 21.05.2008 um 18:34 schrieb Gérard Iglesias:
In fact in its original case, there would be a crash, because
cityArray would point to a trashed pointer... I don't understand why
it is not crashing.
Well, it's not a trashed pointer. The memory has been alloced (and
self is set already), so all that would happen is that everything is
probably initialized to zero. If NSObject doesn't do much
initialization work in -init, you might get away with this bug without
crashing. But you wouldn't want to rely on that...
Oh, by the way, let me plug my memory management tutorials again,
they're mainly for C, but the general procedure stays valid for
Objective C:
What is Memory: http://www.masters-of-the-void.com/book5.htm
And here is one that talks a bit about what happens when you use un-
initialized memory:
Lists of Stuff: http://www.masters-of-the-void.com/book7.htm
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden