Re: Dissappearing textField string value
Re: Dissappearing textField string value
- Subject: Re: Dissappearing textField string value
- From: Graham Cox <email@hidden>
- Date: Mon, 14 May 2012 15:18:01 +1000
On 14/05/2012, at 3:01 PM, Roland King wrote:
> I'm confused. What's the method stringValue on theSudokuTextField? That's one of your methods right as stringValue is a method on NSNumber AFAIK. What does it do?
>
> You're setting the attributedStringValue and the getting the stringValue, in what way are they related?
Well, they are related, but perhaps you stumbled on the answer anyway.
NSTextField inherits -stringValue from NSControl, so that's no problem.
But, if you use -setAttributedStringValue:, you should use -attributedStringValue to retrieve it. Internally, I do not believe that NSControl automatically reduces an attributed string to an ordinary string, but maintains them as totally separate values. If there is an attributed string to display, it will take that over a plain string, but it does not provide any conversion between them.
--Graham
_______________________________________________
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