Re: Bindings and empty text field nil assigments

2008-08-27 Thread Markus Spoettl
On Aug 27, 2008, at 9:21 PM, Quincey Morris wrote: I suspect you can get the effect you want by using a formatter on the text field. Someone was complaining on this list a week or two ago that 10.4+ style formatters never set properties to nil values, but this sounds like the behavior you wa

Re: Bindings and empty text field nil assigments

2008-08-27 Thread Markus Spoettl
On Aug 27, 2008, at 9:32 PM, mmalc crawford wrote: I don't want to go and store NSNumbers instead of scalar values, which I imagine would have the advantage of accepting nil values inherently. Why not? There may be an advantage if you are doing a lot of mathematical calculations, but the

Re: Bindings and empty text field nil assigments

2008-08-27 Thread mmalc crawford
On Aug 27, 2008, at 9:32 PM, mmalc crawford wrote: Not directly. You could implement a value transformer to turn a nil value into a number 0, or (best of all) you could use a formatter to prevent a user from entering a nil in the first place... For a discussion of issues as they relate to

Re: Bindings and empty text field nil assigments

2008-08-27 Thread mmalc crawford
On Aug 27, 2008, at 9:00 PM, Markus Spoettl wrote: I have objects storing simple scalar values (NSInteger, double). Those values/properties are bound to text fields. Now, if the user clears the text field and the underlying property gets updated, it's not simply setting the value to 0 or it

Re: Bindings and empty text field nil assigments

2008-08-27 Thread Quincey Morris
On Aug 27, 2008, at 21:00, Markus Spoettl wrote: I have objects storing simple scalar values (NSInteger, double). Those values/properties are bound to text fields. Now, if the user clears the text field and the underlying property gets updated, it's not simply setting the value to 0 or its

Bindings and empty text field nil assigments

2008-08-27 Thread Markus Spoettl
Hello List, I have objects storing simple scalar values (NSInteger, double). Those values/properties are bound to text fields. Now, if the user clears the text field and the underlying property gets updated, it's not simply setting the value to 0 or its equivalent, instead - (void)setNi