• 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: Block error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Block error


  • Subject: Re: Block error
  • From: Scott Ribe <email@hidden>
  • Date: Fri, 15 Jul 2011 18:05:07 -0600

On Jul 15, 2011, at 5:38 PM, Rick Mann wrote:

> ...except I feel like nil should always work.

Well, that's just a historical problem with C, lack of a null pointer. So instead we get nil which is really just a shortcut for (void*)0, and so only works where void* works, which varies somewhat between K&R C, ANSI C, and C++, and may well require an explicit typecast in some situations where it is a return value mixed with return values of other pointer types. On the other hand, we have NULL, which is often 0 *without* the cast, and may be usable in some situations where void* is not, but is prone to unfortunate effects when calling overloaded functions.

(Thus C++11X gives us nullptr; who knows how that will interact with Objective-C...)

--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Block error (From: Rick Mann <email@hidden>)
 >Re: Block error (From: Jens Alfke <email@hidden>)
 >Re: Block error (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Block error
  • Next by Date: Re: Block error
  • Previous by thread: Re: Block error
  • Next by thread: Re: Block error
  • Index(es):
    • Date
    • Thread