Re: NSTextStorage: efficient way to find a specific attribute?
Re: NSTextStorage: efficient way to find a specific attribute?
- Subject: Re: NSTextStorage: efficient way to find a specific attribute?
- From: Just van Rossum <email@hidden>
- Date: Mon, 12 May 2003 00:48:48 +0200
Marcel Weiher wrote:
>
the NSAttributedString implementation is opaque, so we don't actually
>
know what will be efficient and what not.
>
>
However, -attribute:atIndex:effectiveRange: seems to be your ticket.
>
Start this with index 0. It will return non-nil if the attribute
>
exists at index 0, so you are done in that case.
>
>
If the attribute does *not* exist at that index, effectiveRange will
>
be filled with the range for which the attribute does *not* exist, so
>
effeciveRange.location + effectiveRange.length should point you to
>
the first character where the attribute *does* exist.
>
>
I think that is what you were looking for, right?
Yes, thank you.
Just
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.