Re: When can String.enumerateSubstringsInRange ever pass in NIL?
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