Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selected range in bound text view




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

On Sat, 01 Jul 2006 10:43:00 -0700, "D.K. Johnston" <email@hidden> 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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Selected range in bound text view (From: Matt Neuburg <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.