Re: NSTextArea - how to change the text programmatically?
Re: NSTextArea - how to change the text programmatically?
- Subject: Re: NSTextArea - how to change the text programmatically?
- From: Jens Alfke <email@hidden>
- Date: Sun, 26 Feb 2012 18:57:31 -0800
On Feb 26, 2012, at 5:28 PM, William Squires wrote:
> It's easy enough on an NSTextField (whether it's set up as a static label, or as a data-entry-type field), but where's the .text property of an NSTextArea?
NSTextView? The .textStorage property is an instance of NSTextStorage, a subclass of NSMutableAttributedString.
> Would an NSTextArea be better for this, or an NSTableView?
I suppose it depends on how much you want to be able to display. The nice thing about an NSTableView is that you can display a nearly infinite number of rows without consuming more memory, because only the visible rows consume resources. But if it’s only a small-to-medium amount of text, you could read the bytes and generate an NSString containing the hex dump, and put that into the view.
—Jens
_______________________________________________
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