Re: NSString** in scanners
Re: NSString** in scanners
- Subject: Re: NSString** in scanners
- From: j o a r <email@hidden>
- Date: Wed, 26 Jul 2006 19:38:41 +0200
On 26 jul 2006, at 19.15, D.K. Johnston wrote:
Why do scanner methods such as:
scanCharactersFromSet:intoString:
require an NSString** as their second parameter, rather than simply
an NSString*?
Because the method argument is used to _return_ a pointer to a
NSString object to the caller of the method. This in contrast to how
method arguments are used in the overwhelming majority of cases in
Cocoa; where they're used by the caller to provide the method with an
argument needed for the method to perform it's work.
You will find the same pattern used for many methods returning
NSError, and can find a useful little code snippet here:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
ErrorHandlingCocoa/CreateCustomizeNSError/chapter_4_section_4.html>
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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