• 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: On self = [super init...] ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On self = [super init...] ...


  • Subject: Re: On self = [super init...] ...
  • From: Bill Bumgarner <email@hidden>
  • Date: Thu, 18 Nov 2010 13:16:57 -0800

On Nov 18, 2010, at 1:10 PM, John Engelhart wrote:

> The basic premise behind self = [super init...] is that the "lower levels of initialization are free to return a different object than the one passed in".
>
> However, there is an unstated assumption in this reasoning: whatever object is returned by [super init...] is the one that will be used.


I don't understand the above claim; Why must the object returned by [super init*] be the one that is used?

I'm certainly not aware of any limitation on an init method that would prevent it from… say… calling [super init], releasing whatever is returned if deemed unfit and then allocating an initializing some other instance.

The documentation (http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/ObjectiveC/Articles/ocAllocInit.html) doesn't seem to make any such claim either.

I haven't read beyond the above yet.  Maybe the unstated assumption is explained?

b.bum



_______________________________________________

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: On self = [super init...] ...
      • From: John Engelhart <email@hidden>
    • Re: On self = [super init...] ...
      • From: Thomas Davie <email@hidden>
  • Prev by Date: Re: Core Data: During Migration, should use Primitive Accessors only?
  • Next by Date: Calling a class method with the runtime ObjC API
  • Previous by thread: Re: readonly property which is a mutable array
  • Next by thread: Re: On self = [super init...] ...
  • Index(es):
    • Date
    • Thread