• 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: checking if an object's instance exists.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: checking if an object's instance exists.


  • Subject: Re: checking if an object's instance exists.
  • From: Kevin Ballard <email@hidden>
  • Date: Sat, 5 Feb 2005 13:08:30 -0500

Ah hah. As I said "AFAIK" - I never saw that bit, so I didn't know. I guess it *does* say that.

On the other hand, it's still nice to initialize ivars to null (or whatever you want their default values to be) in the initializer for clarity's sake.

On Feb 5, 2005, at 1:20 AM, Sherm Pendley wrote:

On Feb 5, 2005, at 1:11 AM, Kevin Ballard wrote:

You should also set object1 to nil in your init method to be safe (AFAIK there's no docs saying ivars are zeroed when allocated, so I wouldn't assume it)

Eh? It's right there in the description for +alloc:

"The isa instance variable of the new instance is initialized to a data structure that describes the class; memory for all other instance variables is set to 0."

-- Kevin Ballard email@hidden http://www.tildesoft.com http://kevin.sb.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: checking if an object's instance exists.
      • From: daniel <email@hidden>
References: 
 >checking if an object's instance exists. (From: Aaron Boothello <email@hidden>)
 >Re: checking if an object's instance exists. (From: Kevin Ballard <email@hidden>)
 >Re: checking if an object's instance exists. (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: NSMenuValidation properly
  • Next by Date: Re: NSView and NSMenuItem not updating displays
  • Previous by thread: Re: checking if an object's instance exists.
  • Next by thread: Re: checking if an object's instance exists.
  • Index(es):
    • Date
    • Thread