• 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
Sorting via intValue (Was NSValueTransformer subclass doesn't recognise copyWithZone.)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >NSValueTransformer subclass doesn't recognise copyWithZone. So? (From: John Lombardo <email@hidden>)
 >Re: NSValueTransformer subclass doesn't recognise copyWithZone. So? (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Adding Document Types Programmatically
  • Next by Date: Re: Adding Document Types Programmatically
  • Previous by thread: Re: NSValueTransformer subclass doesn't recognise copyWithZone. So?
  • Next by thread: How to reset a long log...
  • Index(es):
    • Date
    • Thread