• 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: OK to use setCharactersToBeSkipped:nil ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OK to use setCharactersToBeSkipped:nil ?


  • Subject: Re: OK to use setCharactersToBeSkipped:nil ?
  • From: Marco Scheurer <email@hidden>
  • Date: Fri, 30 Jan 2004 16:40:55 +0100

On Jan 30, 2004, at 4:04 PM, Mason Mark wrote:

Yes, that is correct.

There is some default value for characters to be skipped ([NSCharacterSet whitespaceCharacterSet] I think), but your line of code is common and will work as you intend.

I think the question was:" is [someScanner setCharactersToBeSkipped:nil] as valid as [someScanner setCharactersToBeSkipped:[NSCharacterSet emptyCharacterSet]], and is it going to stay that way?"

The answer is not so obvious. Some methods do not like nil parameters. Others specify what the behavior is when passed nil. In the case setCharactersToBeSkipped:, nothing is said. Obviously, passing nil could lead to many possible problems if the implementation changes.

There's also no +emptyCharacterSet method (although one can be created for instance with [NSCharacterSet characterSetWithCharactersInString:@""] or [[[NSCharacterSet alloc] init] autorelease]). This makes it more likely that nil is expected to be used if you want not to skip characters, but this should probably be put in writing in the doc.


Marco Scheurer
Sen:te, Lausanne, Switzerland http://www.sente.ch
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >OK to use setCharactersToBeSkipped:nil ? (From: Matt Gough <email@hidden>)
 >Re: OK to use setCharactersToBeSkipped:nil ? (From: Mason Mark <email@hidden>)

  • Prev by Date: Re: Designing for multitudinous objects
  • Next by Date: Re: Toolbar Icons
  • Previous by thread: Re: OK to use setCharactersToBeSkipped:nil ?
  • Next by thread: a bug in vDSP's vsub()
  • Index(es):
    • Date
    • Thread