Re: Using a Core Data relationship binded to an NSTokenField
Re: Using a Core Data relationship binded to an NSTokenField
- Subject: Re: Using a Core Data relationship binded to an NSTokenField
- From: Orestis Markou <email@hidden>
- Date: Sun, 15 Jun 2008 22:01:55 +0100
Hi,
after some experimentation, I have this Obj-C class that tries to do
the minimal thing:
@implementation OMSetToArrayValueTransformerOBJC
+ (Class) transformedValueClass
{
return [NSMutableArray class];
}
+ (BOOL) allowsReverseTransformation
{
return YES;
}
- (id) transformedValue:(id) value
{
NSLog(@"FORWARD");
return [value allObjects];
}
- (id) reverseTransformedValue:(id) value
{
NSLog(@"REVERSE");
return [NSSet setWithArray:value];
}
Using this, I can edit my token field (delegate methods still not
called), but of course after completing the edit everything is gone,
most probably because nothing is inserted into the Data Store, since
the delegate methods are not called.
I've tried a minimal project to use a plain NSTokenField, without the
table view, and it works fine.
Perhaps I'm doing something wrong in how I setup the NSTokenFieldCell?
What I did was create a plain column, and specify the Text Field Cell
class to be an NSTokenFieldCell, since there's no option of dragging
and dropping something from the Library.
Any minimal example of an NSTokenFieldCell working in an NSTableView
would be enough to get me started, but unfortunately I can't find
anything...
Regards,
--
Orestis Markou
email@hidden
http://orestis.gr/
On 09 Ιουν 2008, at 5:40 ΜΜ, Charles Srstka wrote:
On Jun 9, 2008, at 4:08 AM, Orestis Markou wrote:
If I have allowReverseTransformedValue set to YES, then double
clicking the
row will not show the NSTokenField. The reverseTransformedValue
isn't called
at all.
Do any exceptions or other errors get logged to the console?
Charles
_______________________________________________
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