• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using a Core Data relationship binded to an NSTokenField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Using a Core Data relationship binded to an NSTokenField (From: Orestis Markou <email@hidden>)
 >Re: Using a Core Data relationship binded to an NSTokenField (From: William Turner <email@hidden>)
 >Re: Using a Core Data relationship binded to an NSTokenField (From: "Orestis Markou" <email@hidden>)
 >Re: Using a Core Data relationship binded to an NSTokenField (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Automatically Call a Function
  • Next by Date: Re: looking for a crc code
  • Previous by thread: Re: Using a Core Data relationship binded to an NSTokenField
  • Next by thread: Using NSTrackingArea on overlay child windows
  • Index(es):
    • Date
    • Thread