FROM : Orestis Markou
DATE : Sun Jun 15 23:01:55 2008
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_removed>
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
DATE : Sun Jun 15 23:01:55 2008
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_removed>
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
| Related mails | Author | Date |
|---|---|---|
| Orestis Markou | Jun 8, 23:53 | |
| William Turner | Jun 9, 06:43 | |
| Orestis Markou | Jun 9, 11:08 | |
| Charles Srstka | Jun 9, 18:40 | |
| Orestis Markou | Jun 11, 12:13 | |
| Orestis Markou | Jun 15, 23:01 |






Cocoa mail archive

