Re: Objective-C default initialization

2008-07-11 Thread Sherm Pendley
On Fri, Jul 11, 2008 at 8:10 PM, Greg <[EMAIL PROTECTED]> wrote: > 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 sim

Re: Objective-C default initialization

2008-07-11 Thread Greg
Thank you kindly. :-) On Jul 11, 2008, at 8:18 PM, Ryan Brown wrote: Yes: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/AllocInitObjects.html#/ /apple_ref/doc/uid/2048-1003201 Although it happens on alloc/allocWithZone/etc, not init. Ryan _

Re: Objective-C default initialization

2008-07-11 Thread Ryan Brown
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/AllocIn

Objective-C default initialization

2008-07-11 Thread Greg
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;