Obj-C difference between NULL and nil
Obj-C difference between NULL and nil
- Subject: Obj-C difference between NULL and nil
- From: Chris Lemler <email@hidden>
- Date: Sat, 26 May 2001 09:33:00 -0700
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