Re: Core Data & Bindings: Non-string types in an NSTableView
Re: Core Data & Bindings: Non-string types in an NSTableView
- Subject: Re: Core Data & Bindings: Non-string types in an NSTableView
- From: Mike Abdullah <email@hidden>
- Date: Wed, 18 Apr 2007 14:02:55 +0100
Two options off the top of my head:
*Add an NSNumberFormatter or NSDateFormatter to the column. They're
in the text section of IB.
*Write your own NSValueTransformer to convert strings to dates.
Mike.
On 18 Apr 2007, at 13:55, Kevin Hoffman wrote:
Folks,
I'm sure this qualifies as a "newbie" question, but I'll ask
anyway. I
was looking at the videos of the Core Data tutorial and I noticed that
none of the tabular items being bound were anything but strings.
I have a situation where I have an entity that has a Date column
and an
Int32 column. I set up the bindings using Core Data, set up a
controller
- everything works fine when I set the data types to string. However,
when I set the data types in the model to what they should be, I keep
getting errors from the GUI indicating that it was an inappropriate
type
(e.g. "string" when expecting an NSCFDate etc).
I have tried dragging a datepicker cell into the cell in the
tableview,
but that doesn't quite do the trick. Also, I can't figure out how to
deal with the cell that I want to allow me to enter integers. I
type in,
say, "200", then hit tab to commit that cell, and then I see the error
in the Console log showing that it got the string "200" instead of the
number 200.
I'm sure there's a simple solution to this - can anyone tell me what
step I'm missing to get my table to allow me to pick dates (hopefully
from a pop-up calendar, or at least default to today's date) and enter
numbers directly into the table?
Thanks,
Kevin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
40mikeabdullah.net
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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