RE: Cocoa bindings problem
RE: Cocoa bindings problem
- Subject: RE: Cocoa bindings problem
- From: Squ Aire <email@hidden>
- Date: Fri, 30 Oct 2009 19:01:16 +0000
- Importance: Normal
Thanks for the tip. However, the value transformer idea did not work. Even though it ended up showing exactly the same date (the value transformer just strips the time from the date) for each row, selecting multiple rows still leaves us with "Multiple values" in the text field.
> > 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.
_________________________________________________________________
Windows Live Hotmail: Your friends can get your Facebook updates, right from HotmailĀ®.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009_______________________________________________
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