• 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
Re: Getting an NSString out of an NSTextView;
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting an NSString out of an NSTextView;


  • Subject: Re: Getting an NSString out of an NSTextView;
  • From: Ryan Bates <email@hidden>
  • Date: Tue, 10 Feb 2004 21:07:17 -0800

On Feb 10, 2004, at 5:06 PM, Robert Tillyard wrote:
My problem seems to be that my version of Cocoa Browser doesn't show a method string: for NSTextStorage and I missed it on the online documentation.

The reason you do not see the "string" method in the NSTextStorage or NSTextView documentation is due to inheritance. At the top of the NSTextView documentation you see this:

NSTextView

Inherits from:
NSText : NSView : NSResponder : NSObject

This means that all instance variables and methods that are in these classes will be in the NSTextView. If you take a look at NSText you will see that it contains a "string" method. This is why you can call [textView string]. For that same reason you can call [textStorage string] because it inherits from NSAttributedString which contains the "string" method. The terms "superclass" and "subclass" refer to the parent and child classes respectively. If I were to subclass NSTextView I would inherit all of the NSTextView features and be able to add my own. I suggest picking up a good book on object-oriented programming (OOP) with Objective-C - it is vital to have a good understanding of it when programming in Cocoa. I suggest "Programming in Objective-C" by Stephen G. Kochan. Here's the amazon link:
<http://www.amazon.com/exec/obidos/tg/detail/-/0672325861/>

Ryan
_______________________________________________
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.

References: 
 >Getting an NSString out of an NSTextView; (From: Robert Tillyard <email@hidden>)
 >Re: Getting an NSString out of an NSTextView; (From: Douglas Davidson <email@hidden>)
 >Re: Getting an NSString out of an NSTextView; (From: Robert Tillyard <email@hidden>)

  • Prev by Date: Re: At my wits end with NSSound!
  • Next by Date: Re: At my wits end with NSSound!
  • Previous by thread: Re: Getting an NSString out of an NSTextView;
  • Next by thread: Re: Getting an NSString out of an NSTextView;
  • Index(es):
    • Date
    • Thread