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: Daryle Walker <email@hidden>
- Date: Sun, 29 May 2016 22:16:58 -0400
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?
—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com
> On May 29, 2016, at 12:08 AM, Ken Thomases <email@hidden> wrote:
>
> On May 28, 2016, at 8:27 PM, Daryle Walker <email@hidden> wrote:
>>
>> The last argument to the method is a closure with four parameters. The first argument is an optional String. I can't think of a circumstance where it'll be NIL. (I need to know for testing.) Especially since it can be recreated in terms of the callback's second argument, which isn't optional. (So the string can be empty at worst.). Am I missing something, or is this a bug (and should be non-optional)?
>
> One can pass NSStringEnumerationOptions.SubstringNotRequired in the options to tell the framework to not bother creating that substring, which can be expensive, if you don't need it. In that case, it will pass nil to your block.
_______________________________________________
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