Sorting via intValue (Was NSValueTransformer subclass doesn't recognise copyWithZone.)
Sorting via intValue (Was NSValueTransformer subclass doesn't recognise copyWithZone.)
- Subject: Sorting via intValue (Was NSValueTransformer subclass doesn't recognise copyWithZone.)
- From: John Lombardo <email@hidden>
- Date: Fri, 7 May 2004 01:05:18 +0800
Wow, that's really embarrassing :)
It totally makes sense, though... Why else would I bother with the
setValueTransformer:forName: stuff :P
Unfortunately, this has revealed a new issue. I was under the
impression that the default compare: method used for sorting
tableColumns would sort NSNumbers as numbers, rather than strings.
Assuming I was wrong, how would I go about programatically binding a
new intValue aware compare method?
Cheers,
john
On 06/05/2004, at 11:18 PM, Fritz Anderson wrote:
The NSValueTransformerName key in the binding options dictionary takes
an NSString for the registered name of the transformer, not an
instance of the transformer itself. That's probably the source of the
attempted copy.
-- F
On 6 May 2004, at 6:06 AM, John Lombardo wrote:
When trying to use my NSValueTransformer subclass I get the following
error:
*** -[BBStringToNumberTransformer copyWithZone:]: selector not
recognized
...
if ([[[recordArray lastObject] objectForKey:key]
isEqualToString:@"int4"])
[bindingOptions setObject:[NSValueTransformer
valueTransformerForName:@"StringToNumberTransformer"]
forKey:@"NSValueTransformerName"];
[[lookupTable tableColumnWithIdentifier:key]
bind:@"value"
toObject: recordController
withKeyPath:[NSString stringWithFormat:@"arrangedObjects.%@", key]
options:bindingOptions];
--
Fritz Anderson
Consulting Programmer
http://resume.manoverboard.org/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.