• 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: NSString** in scanners
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSString** in scanners (From: "D.K. Johnston" <email@hidden>)

  • Prev by Date: Re: Document not opened at launch?
  • Next by Date: Re: Document not opened at launch?
  • Previous by thread: NSString** in scanners
  • Next by thread: Fwd: NSString** in scanners
  • Index(es):
    • Date
    • Thread