• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
trapping NSTextView keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trapping NSTextView keys


  • Subject: trapping NSTextView keys
  • From: Duncan Campbell <email@hidden>
  • Date: Fri, 15 Jul 2005 15:49:17 +1000

Hey folks.

I have an NSTextView with a very large amount of text loaded into it.

I wish to perform a function on this text, with each keystroke - however this function is very expensive and takes a long time to complete.

What i have done is to setup a timer that fires in the textDidChange: event - this causes a delay between keystrokes and the beginning of the function (the timer is reset every time a key is pressed) - which means the user can keep on typing and once they stop, the function will be performed.

However, once the function starts I am unable to stop it until it completes. I have tried setting a boolean in the textDidChange: event, however it seems this event is not registered until after the function completes.

Can anyone give me any pointers? Do I need to perhaps run the function in it's own thread? (and would this cause it to notice a change in my boolean var)? Am I going about this all wrong?

Many thx.

D.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: CoreData: XML escaping and exporting to another persistent store format
  • Next by Date: Re: how to evaluate an NSString content as a real obj-c instruction/expression
  • Previous by thread: More Sync Services Framework Questions...
  • Next by thread: Easy one.
  • Index(es):
    • Date
    • Thread