• 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: Why is NULL used sometimes when documentation specifies nil?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is NULL used sometimes when documentation specifies nil?


  • Subject: Re: Why is NULL used sometimes when documentation specifies nil?
  • From: Shawn Erickson <email@hidden>
  • Date: Thu, 13 Jan 2005 07:50:01 -0800


On Jan 13, 2005, at 7:32 AM, Jeremy French wrote:

What is the difference between nil and NULL?

Why does the Foundation Reference for NSScanner specify nil to skip search results, while the NSScanner example in "Strings" documentation uses NULL to omit results?
[snip
So why is NULL used sometimes when documentation specifies nil?

Well nil is used to imply no object in Cocoa Objective-C and NULL for traditional uses of NULL in C. In reality they are one in the same value so they can be used interchangeably.


The code example, in a perfect world, should be using nil since intoString is expecting an object.

-Shawn

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


  • Follow-Ups:
    • Re: Why is NULL used sometimes when documentation specifies nil?
      • From: Roarke Lynch <email@hidden>
References: 
 >Why is NULL used sometimes when documentation specifies nil? (From: Jeremy French <email@hidden>)

  • Prev by Date: Why is NULL used sometimes when documentation specifies nil?
  • Next by Date: Re: Binding Tableviews (newbie) problems/questions
  • Previous by thread: Why is NULL used sometimes when documentation specifies nil?
  • Next by thread: Re: Why is NULL used sometimes when documentation specifies nil?
  • Index(es):
    • Date
    • Thread