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: Mon, 9 Jun 2008 10:08:54 +0100
Thanks for the reply. I'm not on my Mac now, and the code is a bit messy
because of all the experiments, but here are my assumptions:
My value transformer returns an instance of NSMutableArray, that becomes the
value of the NSTokenField
Its transormedValue: takes an NSSet (actually it's a collection of faults,
but that shouldn't matter, right?), and just creates an NSArray wth it.
Its reverseTransformedValue: takes an NSArray (returned from the
NSTokenField) and creates an appropriate NSSet to be used with Core Data.
So far, what I've got working is:
If I have allowReverseTransformedValue set to NO, then double clicking the
row will show the NSTokenField, which I can edit. It seems that its delegate
methods are not called, so I can't do anything with the values.
If I have allowReverseTransformedValue set to YES, then double clicking the
row will not show the NSTokenField. The reverseTransformedValue isn't called
at all.
Hope that brings some information. I'll post my code when I go home. I'm
using PyObjC, but I don't think it matters (I have a similar value
transformer working with NSTextField).
Regards,
Orestis
On Mon, Jun 9, 2008 at 5:43 AM, William Turner <email@hidden> wrote:
> On Jun 8, 2008, at 2:53 PM, Orestis Markou wrote:
>
>> I have a list of articles, binded to an NSArrayController binded to an
>> NSTableView.
>>
>> Each article can have multiple authors, which I want to display in one
>> row, using an NSTokenField.
>>
>> It seems like the NSTokenField expects an NSArray, and it gets an NSSet,
>> which it ignores.
>>
>> I've tried doing this with a Value Transformer, but I can't seem to get it
>> working. I have managed to do it with a plain NSTextField by parsing
>> comma-separated strings (so it seems that the wiring is correct), but it's a
>> mess and tokens are really better suited.
>>
>>
> This shouldn't be a problem - could you post the code for your value
> transformer?
>
> Wil
>
>
--
Orestis Markou
email@hidden
http://orestis.gr
_______________________________________________
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