• 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: When can String.enumerateSubstringsInRange ever pass in NIL?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When can String.enumerateSubstringsInRange ever pass in NIL?


  • Subject: Re: When can String.enumerateSubstringsInRange ever pass in NIL?
  • From: Ken Thomases <email@hidden>
  • Date: Mon, 30 May 2016 00:31:02 -0500

On May 29, 2016, at 9:54 PM, Quincey Morris <email@hidden> wrote:
>
> On May 29, 2016, at 19:16 , Daryle Walker <email@hidden <mailto:email@hidden>> wrote:
>>
>> Since I am using the substring and not including “.SubstringNotRequired”, I can just remove the “guard” block, tack on a “!” to substring’s identifier, and be done with it, right?
>
> The problem is there’s no API contract that says exactly when (and when not) the string will be nil.

I think the documentation for SubstringNotRequired is sufficient design contract:

"NSStringEnumerationSubstringNotRequired
"A way to indicate that the block does not need substring, in which case nil will be passed. This is simply a performance shortcut."

The strong implication is that when that option is not supplied, nil will not be passed.  Certainly, I'd feel betrayed by the docs to discover otherwise.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: When can String.enumerateSubstringsInRange ever pass in NIL?
      • From: Quincey Morris <email@hidden>
References: 
 >When can String.enumerateSubstringsInRange ever pass in NIL? (From: Daryle Walker <email@hidden>)
 >Re: When can String.enumerateSubstringsInRange ever pass in NIL? (From: Ken Thomases <email@hidden>)
 >Re: When can String.enumerateSubstringsInRange ever pass in NIL? (From: Daryle Walker <email@hidden>)
 >Re: When can String.enumerateSubstringsInRange ever pass in NIL? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: NSDocument not displaying save prompt on dirty document
  • Next by Date: Re: debugging AirDrop (update)
  • Previous by thread: Re: When can String.enumerateSubstringsInRange ever pass in NIL?
  • Next by thread: Re: When can String.enumerateSubstringsInRange ever pass in NIL?
  • Index(es):
    • Date
    • Thread