• 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
Bindings and empty text field nil assigments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings and empty text field nil assigments


  • Subject: Bindings and empty text field nil assigments
  • From: Markus Spoettl <email@hidden>
  • Date: Wed, 27 Aug 2008 21:00:23 -0700

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)setNilValueForKey:(NSString *)key

is invoked. Failing to implement it causes an exception when exiting out of a cleared text field bound to a scalar value.

I was wondering if there was a more direct and less glue-code involving way of doing this. 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.

Can I tell the bindings system to directly set scalars to 0 in case of nil values?

Regards
Markus
--
__________________________________________
Markus Spoettl

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Bindings and empty text field nil assigments
      • From: mmalc crawford <email@hidden>
    • Re: Bindings and empty text field nil assigments
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: File Extensions Problem
  • Next by Date: Re: Bindings and empty text field nil assigments
  • Previous by thread: Re: Deep Recursion
  • Next by thread: Re: Bindings and empty text field nil assigments
  • Index(es):
    • Date
    • Thread