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

Re: Objective-C default initialization


  • Subject: Re: Objective-C default initialization
  • From: Ryan Brown <email@hidden>
  • Date: Fri, 11 Jul 2008 17:18:03 -0700

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?

Yes:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/AllocInitObjects.html#/ /apple_ref/doc/uid/20000048-1003201

Although it happens on alloc/allocWithZone/etc, not init.

Ryan
_______________________________________________

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: Greg <email@hidden>
References: 
 >Objective-C default initialization (From: Greg <email@hidden>)

  • Prev by Date: Objective-C default initialization
  • Next by Date: Re: Storing structured data in file - any easy way?
  • Previous by thread: Objective-C default initialization
  • Next by thread: Re: Objective-C default initialization
  • Index(es):
    • Date
    • Thread