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: Robert Walker <email@hidden>
- Date: Wed, 18 Apr 2007 11:18:06 -0400
*Add an NSNumberFormatter or NSDateFormatter to the column.
They're in the text section of IB.
Also, it's my understanding that using the formatters available in IB
use the pre-10.4 formatters. If you want or need to use the 10.4
formatter behavior you'll need to add the formatters from code. Not
that this should present any particular problems, but just something
to take note of.
Once you drop the formatter onto a table view column you'll see
another option in the inspector's popup for adjusting the date or
number format that you would like to use.
On Apr 18, 2007, at 9:02 AM, Mike Abdullah wrote:
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:
40mac.com
This email sent to email@hidden
--
Robert Walker
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