• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trying to understand -- please help...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Trying to understand -- please help... (From: "john darnell" <email@hidden>)
 >Re: Trying to understand -- please help... (From: "Hank Heijink (Mailinglists)" <email@hidden>)
 >Re: Trying to understand -- please help... (From: Gérard Iglesias <email@hidden>)

  • Prev by Date: Core-Data Multithreading question about save
  • Next by Date: Re: connections and the nib lifecycle
  • Previous by thread: RE: Trying to understand -- please help...
  • Next by thread: Re: Trying to understand -- please help...
  • Index(es):
    • Date
    • Thread