Re: Deleting the last word of an NSString
Re: Deleting the last word of an NSString
- Subject: Re: Deleting the last word of an NSString
- From: Aki Inoue <email@hidden>
- Date: Fri, 5 Aug 2005 18:19:18 -0700
One question - why is that method in NSAttributedString rather than
NSString? Surely NSAttributedStrings are more about the display
and presentation of a string, whereas nextWordFromIndex sounds like
something common to both classes...
Because it gives us extensibility. By using NSAttributedString, we
could define new attributes for tweaking breaking behavior.
Aki
Ahh - handy, thanks.
One question - why is that method in NSAttributedString rather than
NSString? Surely NSAttributedStrings are more about the display
and presentation of a string, whereas nextWordFromIndex sounds like
something common to both classes...
Jon
On 6 Aug 2005, at 01:44, Aki Inoue wrote:
-[NSAttributedString nextWordFromIndex:forward:] is what the Text
System uses.
Aki
I need to delete the last word in an NSString. In theory, this
is easy, but I need to replicate the behaviour of a Cocoa text
field when you press Option-Backspace. I keep on running into
special cases where my solution doesn't quite match up, and was
wondering if there was a definitive way of finding what the last
word is, complete with Cocoa's considerations for punctuation.
Thanks,
Jon
_______________________________________________
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
_______________________________________________
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