Re: Of course I forgot some NSTextFinder questions
Re: Of course I forgot some NSTextFinder questions
- Subject: Re: Of course I forgot some NSTextFinder questions
- From: Daryle Walker <email@hidden>
- Date: Tue, 21 Mar 2017 05:31:36 -0400
> On Mar 20, 2017, at 1:41 PM, Quincey Morris <email@hidden> wrote:
>
> On Mar 20, 2017, at 04:58 , Daryle Walker <email@hidden <mailto:email@hidden>> wrote:
>>
>>> If all the strings were concatenated together would be the ‘x’ in "fox”.
>
>> Is there a off-by-one bug with the end of the second string? Or am I really misunderstanding Apple’s counting strategy? The second string seems to be only 9 characters long. And shouldn't index 18 point to the first character of the third string instead?
>
> There’s clearly an omission in that sentence in the documentation, and it appears to mean to say: If all the strings were concatenated together, the 18th character would be the ‘x’ in “fox”.
>
> Looking at the example concatenation in the next paragraph, it appears that the expectation is that the “conceptually concatenated string” has spaces inserted between the substrings, and that would account for the extra character in the “fox” text. My guess is that putting conceptual spaces in the conceptual concatenation has something to do with the proper recognition of word boundaries (in some languages), but it’s not clear how that works in practice.
>
There’s nothing conceptual about; it’s a different bug instead!
A lot of new(-ish) Apple API don’t get guides, but have semi-extensive instruction in the AppKit (or whatever) notes for the first version of macOS the API premiered. The Mac OS X 10.7 Lion part of the 10.11-and-before AppKit notes (<https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKitOlderNotes/index.html#10_7TextFinder>) uses this very example, but there is a space character before the “brown”! So the problem is there was a transcription error between the AppKit notes and the API page. (But there isn’t an extra space before the third string or another space either at the end of the third string or the start of the fourth.)
> A bug report would probably be appropriate.
—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com
_______________________________________________
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