Why is NULL used sometimes when documentation specifies nil?
Why is NULL used sometimes when documentation specifies nil?
- Subject: Why is NULL used sometimes when documentation specifies nil?
- From: Jeremy French <email@hidden>
- Date: Thu, 13 Jan 2005 10:32:11 -0500
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?
In particular, the reference for the NSScanner method
"scanString:intoString:" says, "invoke this method with nil as
stringValue to simply scan past a given string."
But the example (in "Strings" documentation 2004-06-28) use NULL,
instead of nil, to skip sanned results?
<snippet from example>
while ([theScanner isAtEnd] == NO) {
if ([theScanner scanString:PRODUCT intoString:NULL] &&
[theScanner scanUpToCharactersFromSet:semicolonSet
intoString:&productName] &&
[theScanner scanString:@";" intoString:NULL] &&
[theScanner scanString:COST intoString:NULL] &&
[theScanner scanFloat:&productCost]) {
// do something here
} else return NO;
}
</snipper from example>
So why is NULL used sometimes when documentation specifies nil?
----
Details:
Reference says use nil for scanString:intoString:
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSScanner.html#//apple_ref/doc/uid/20000159/
scanString_intoString_>
Example in documentation uses NULL
<http://developer.apple.com/documentation/Cocoa/Conceptual/Strings/
index.html>
_______________________________________________
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