• 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: Deleting contents of NSTextView...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting contents of NSTextView...


  • Subject: Re: Deleting contents of NSTextView...
  • From: Shawn Erickson <email@hidden>
  • Date: Sun, 30 Jun 2002 21:01:58 -0700

On Sunday, June 30, 2002, at 07:10 PM, Sherm Pendley wrote:

On Sunday, June 30, 2002, at 09:28 PM, Isaac Sherman wrote:

Because it doesn't actually inherit from NSControl.

Heh... I noticed that, about thirty seconds after I posted my question. D'oh!

Still, it seems odd; one of the things that I find appealing about Cocoa, compared to Swing, MFC, GTK, etc., is its self-consistency. That's why it strikes me as odd that, while NSControl and NSCell (which doesn't inherit from NSControl) have setStringValue: methods, the NSText and NSString methods that serve the same purpose are called setString: instead.

Now that I've thought about it more, I'm wondering if the methods really do exactly the same thing. Do the different method names imply slightly different operations? That is, does setStringValue: make a copy of the string that's passed to it, and setString retain the passed string instead?

I believe the name convention follows the idea that your are setting a value and what you can use to set it is some arbitrary type (int, double, string, etc.). The naming is your way of telling, for example, a control that I want you to set your value to something and that something should be read from a string, int, double, or object.

In the case of NSText it only supports text so it only accepts NSStrings. Basically NSText objects don't support an arbitrary value, only text with modifiers.

I think it is self-consistent in the scope of the class.

-Shawn
_______________________________________________
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: 
 >Re: Deleting contents of NSTextView... (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Finding the source of a SIGPIPE
  • Next by Date: Re: Gif to TIFF and transparency
  • Previous by thread: Re: Deleting contents of NSTextView...
  • Next by thread: Re: Delete contents of NSTextView...
  • Index(es):
    • Date
    • Thread