finding the insertion point of an NSTextView
finding the insertion point of an NSTextView
- Subject: finding the insertion point of an NSTextView
- From: Jake MacMullin <email@hidden>
- Date: Sun, 10 Feb 2002 14:16:11 +1030
I'm trying to write an autocompleter for a cocoa based app - I figured
I'd create a delegate for my NSTextView and write some code in the
textDidChange() method to find some suggestions for the current partial
word. However, I'm stuck before I have even begun. I can't figure out
how to find out what the current partial word is in a NSTextView.
This is how I was planning to approach it:
find out where the insertion point is.
backtrack to the last space.
return an NSRange from that position to the insertion point.
And having an NSRange that points to the last partial word, I could look
up possible words that begin with the partial word. So, is there a way
of finding the location of the insertion point? If not, any suggestions?
Thanks,
Jake MacMullin
_______________________________________________
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.