• 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
Re: Cocoa bindings problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa bindings problem


  • Subject: Re: Cocoa bindings problem
  • From: "I. Savant" <email@hidden>
  • Date: Thu, 29 Oct 2009 21:58:10 -0400

On Oct 29, 2009, at 9:44 PM, Squ Aire wrote:

My problem is that when I bind a some text field to the "last login date" column, and choose multiple rows with same date (but NOT THE SAME TIME), I get "Multiple Values".

Do you mean you have a separate NSTextView or NSTextField that is bound to the array controller's selection.lastLoginDate? This is a classic master/detail view setup.



How can I make it just show the date without time in the text field? Can bindings accommodate me in some way to accomplish this?

If you have multiple rows selected, there's no way for the mechanism to 'know' (or trust) that the dates are the same. Indeed they're not (in the "this exact timestamp" sense, nor, likely, in the "same object by pointer" sense).


You might try an NSValueTransformer to substitute one date with a "best-guess" date (allowing for differing "to-the-day" dates), following whatever logic you want. I don't know if this'll work for multiple values, though. I've never done what you're proposing personally.

--
I.S.


_______________________________________________

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: Cocoa bindings problem
      • From: Squ Aire <email@hidden>
References: 
 >Cocoa bindings problem (From: Squ Aire <email@hidden>)

  • Prev by Date: Re: how to filter available fonts for my application?
  • Next by Date: Re: Detecting a network connection
  • Previous by thread: Cocoa bindings problem
  • Next by thread: RE: Cocoa bindings problem
  • Index(es):
    • Date
    • Thread