• 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
Objective-C default initialization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Objective-C default initialization


  • Subject: Objective-C default initialization
  • From: Greg <email@hidden>
  • Date: Fri, 11 Jul 2008 20:10:53 -0400

I've noticed that objects get initialized to nil if you don't set them, is this guaranteed in objective-c?

I've been trying to find documentation from Apple on this but have been unable.

In other words, if you have a simple class like this:

@interface MyClass : NSObject {
	id obj;
}
@end

Then when -init is called is 'obj' *guaranteed*, always, in all versions of OS X, to be nil?


Thanks,

- Greg
_______________________________________________

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


  • Follow-Ups:
    • Re: Objective-C default initialization
      • From: "Sherm Pendley" <email@hidden>
    • Re: Objective-C default initialization
      • From: Ryan Brown <email@hidden>
  • Prev by Date: Re: NSSpeechSynthesizer lifetime and garbage collected (GC) applications
  • Next by Date: Re: Objective-C default initialization
  • Previous by thread: Re: PDFDocument Subclass and Undo Manager Redux
  • Next by thread: Re: Objective-C default initialization
  • Index(es):
    • Date
    • Thread