Re: Second try: Setting text in NSTextView
Re: Second try: Setting text in NSTextView
- Subject: Re: Second try: Setting text in NSTextView
- From: Michael Fenske <email@hidden>
- Date: Thu, 9 Jan 2003 18:47:31 +0100
Am Donnerstag, 09.01.03, um 05:00 Uhr (Europe/Berlin) schrieb Alex Rice:
I don't see setText: in the API for NSTextStorage or any of it's
superclasses, although I could be overlooking it. Is that why you are
puzzled?
Yes, this is the reason.
This is a total guess: if you could to look in the implementation
source code of NSTextStorage you might see a private interface like
this:
@interface NSTextStorage (privateOrDeprecatedInterface)
-(void) setText: (NSString *) s;
@end
So NSTextStorage objects would respond to that message even though
it's not in the headers the API anywhere.
This makes sense. At compile time, the compiler thinks NSTextStorage
did not respond to -setText:, but at runtime it does.
But you should stick with public interfaces like the ones offered by
NSTextView. NSTextStorage is a "semiconcrete subclass of
NSMutableAttributedString". That makes it sound like it's not for
general use.
I agree with you. I send -setString: to a NSTextView to set a new text.
I asked only for curiosity.
Thanks
Michael
_______________________________________________
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.