• 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
Fwd: Obj-C difference between NULL and nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Obj-C difference between NULL and nil


  • Subject: Fwd: Obj-C difference between NULL and nil
  • From: Chris Lemler <email@hidden>
  • Date: Sat, 26 May 2001 09:45:02 -0700

Begin forwarded message:

From: Chris Lemler <email@hidden>
Date: Sat May 26, 2001 09:33:00 AM US/Pacific
To: email@hidden
Subject: Obj-C difference between NULL and nil

I have been reading thru the code for various Obj-C programs, and I have seen some people consistently use NULL, and others use nil:

NSMutableArray *myArray;

myArray = NULL;

or

myArray = nil;

Are there any real advantages to using one over the other? Does it make any difference when releasing an object that was never allocated:

myArray = NULL;
[myArray release];

versus

myArray = nil;
[myArray release];

Thanks for any tips,
Chris


  • Prev by Date: Re: Why Objective-C over Java?
  • Next by Date: Re: Obj-C difference between NULL and nil
  • Previous by thread: Re: Obj-C difference between NULL and nil
  • Next by thread: Aqua Human Interface Mailing List
  • Index(es):
    • Date
    • Thread