• 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: init returns nil or raises exception?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: init returns nil or raises exception?


  • Subject: Re: init returns nil or raises exception?
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 7 Oct 2010 09:04:34 -0700

On Thu, Oct 7, 2010 at 12:47 AM, Remco Poelstra <email@hidden> wrote:
> While still in the process of cleaning up my code, I read in the documentation of NSObject that -init should return nil if it fails to initialize. But a paragraph lower it's stated that -init should always return a functional instance or raise an exception. Isn't that in conflict with the allowance of returning nil?

File a documentation bug. I would imagine the paragraph about the
exception is saying that an exception must be raised rather than
returning a half-constructed instance of the object.

--Kyle Sluder
_______________________________________________

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: init returns nil or raises exception?
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >init returns nil or raises exception? (From: Remco Poelstra <email@hidden>)

  • Prev by Date: Re: -[NSImage setBackgroundColor:] not working in 10.6
  • Next by Date: Re: reused tableViewCell UILabel text is deallocated but not nil ??
  • Previous by thread: init returns nil or raises exception?
  • Next by thread: Re: init returns nil or raises exception?
  • Index(es):
    • Date
    • Thread