But with your way, the method can't be reasonably unit-tested since a NIL may come up randomly. That seems pointless since you can synthesize the string from the other parameters anyway.
Sent from my iPhone > On May 30, 2016, at 5:42 AM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > >> On May 29, 2016, at 22:31 , Ken Thomases <k...@codeweavers.com> wrote: >> >> 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." > > This contract is of the form “if A then B”, from which it is NOT generally > valid to conclude “if not-A then not-B”. Plausibly, you can read a hidden > “only” into the documentation, but I’d still suggest not relying on it, since > it seems unnecessary. > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com