• 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
NSTextView vs NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView vs NSTextField


  • Subject: NSTextView vs NSTextField
  • From: Eric Gorr <email@hidden>
  • Date: Thu, 11 Nov 2010 08:45:07 -0500

It seems to me that NSTextView can do everything that NSTextField can and more. For example, on a NSTextView, one can use the method setHorizontallyResizable: and then call sizeToFit to get it to resize itself vertically instead of horizontally.

Is this correct?

If so and if I am programmatically creating one of these controls, is there any reason why I would want to use a NSTextField?
(I know that IB uses a NSTextField for Labels, for example...is this just a historical artifact?)

If not, what are the key differences between them that would cause me to want to use a NSTextField? Would it basically come down to whether or not I need more then a single line of text or not...NSTextField seems to be optimized for single lines of text, but one can still get the same behavior out of a NSTextView with a bit more work.

Now, I know that NSTextFieldCell is commonly used as a superclass for one's own cell based stuff, but I would consider that as separate from the issue of NSTextField vs NSTextView.

Thank you.





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTextView vs NSTextField
      • From: Ron Fleckner <email@hidden>
    • Re: NSTextView vs NSTextField
      • From: Erik Buck <email@hidden>
    • Re: NSTextView vs NSTextField
      • From: Ross Carter <email@hidden>
References: 
 >NSTextView & Vertical resizing using sizeToFit (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: Detecting reading a key in KVC
  • Next by Date: RTFDFromRange returns different data
  • Previous by thread: Re: NSTextField & Vertical resizing using sizeToFit
  • Next by thread: Re: NSTextView vs NSTextField
  • Index(es):
    • Date
    • Thread