Skip navigation.
 
mlRe: Selected range in bound text view
FROM : D.K. Johnston
DATE : Sun Jul 02 16:12:13 2006

On 2 Jul, 2006, at 00:46, Matt Neuburg wrote:

> On Sat, 01 Jul 2006 10:43:00 -0700, "D.K. Johnston" <<email_removed>> 
> said:

>> I'm trying to setSelectedRange in a text view that is bound to a
>> window controller (via attributedString). I can see no relevant
>> binding in the text view. I've got an IBOutlet connected to the text
>> view, but sending a setSelectedRange message to it has no effect.

>
> The binding is a red herring. It should work fine. I'm betting that 
> your
> IBOutlet is nil, or some such slip-up. m.
>


I found the problem. The setSelectedRange message is being received; 
but the text view (for reasons known only to itself) was then 
resetting the selected range to a blank line at the end of the text. 
Since the line was blank, the highlighting wasn't visible.

I've since got rid of the blank line. Now all I need to do is to 
figure out how to send my setSelectedRange message after the text 
view has finished doing whatever it is it has to do. I'm sending it 
after the text view has loaded its attributed string.

dkj

Related mailsAuthorDate
mlSelected range in bound text view D.K. Johnston Jul 1, 19:43
mlRe: Selected range in bound text view Matt Neuburg Jul 2, 09:46
mlRe: Selected range in bound text view D.K. Johnston Jul 2, 16:12