• 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: returning nil on initialization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: returning nil on initialization


  • Subject: Re: returning nil on initialization
  • From: Bob Ippolito <email@hidden>
  • Date: Thu, 1 Apr 2004 18:45:12 -0500

On Apr 1, 2004, at 5:45 PM, Scott Anguish wrote:

On Apr 1, 2004, at 4:40 PM, John Stiles wrote:

I'm under the impression that the result of [super init] and the
variable self will always be the same.

This is not true. The super is free to return something else. (I don't know of any concrete examples, but Objective-C books sometimes warn about this.)


even if super does change self, it'll be reflected in the value of self that the subclass is using.

No it won't. The subclass calls the super implementation, not vice versa. If the subclass returns the wrong thing, then all is lost :)

-bob
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: returning nil on initialization (From: Daniel Waylonis <email@hidden>)
 >Re: returning nil on initialization (From: John Stiles <email@hidden>)
 >Re: returning nil on initialization (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: Which NSCompositingOperation the Dock uses for highlight the icons?
  • Next by Date: Re: Threads and locks
  • Previous by thread: Re: returning nil on initialization
  • Next by thread: Re: returning nil on initialization
  • Index(es):
    • Date
    • Thread