Re: responding to NSStepper clicks
Re: responding to NSStepper clicks
- Subject: Re: responding to NSStepper clicks
- From: Koen van der Drift <email@hidden>
- Date: Sat, 17 Dec 2011 06:29:03 -0500
On Dec 16, 2011, at 11:48 PM, Quincey Morris wrote:
> There are various solutions you might choose, depending on how you expect to handle validation errors for your text field. You can add a number formatter to the field, or you can change the property to type long long (though you then need to check for negative numbers yourself), or you can use KVC validation to substitute a NSNumber object for the NSString object.
Changing the value from NSInteger to NSNumber in my model did the trick, I don't get the crash anymore, and everything updates accordingly. I don't have to use a formatter either, although I probably need to add anyway to prevent the user from typing anything else but numbers.
The only that does't work yet is that I need to hit enter or tab to have my model respond to a change in the NSTextField. As suggested earlier, I set the binding "Continuously Update Value", but that doesn't work.
I also see a small exclamation mark (white on a red circle), in the Model Key Path bindings field, where I bind to my model. Xcode autocompletes the correct property, so I'm not sure what to do with this, since everything works. I don't see that exclamation mark in the NSStepper bindings field.
- Koen.
_______________________________________________
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