#109 ✓resolved
Nick Takayama

CPString compare: implementation

Reported by Nick Takayama | October 15th, 2008 @ 07:08 AM

Really simple patch. Implementing CPString compare: so that the default selector used in CPSortDescriptor will work with CPString objects.

Comments and changes to this ticket

  • cacaodev

    cacaodev October 16th, 2008 @ 12:17 AM

    I'm not sure to understand why you pass CPLitteralSearch as an option for compare:

    From Cocoa documentation:

    NSString compare: Returns the result of invoking compare:options:range: with no options and the receiver’s full extent as the range.

  • Nick Takayama

    Nick Takayama October 16th, 2008 @ 12:42 AM

    Because if you read the documentation a bit more you will see:

    Search and comparison are currently performed as if the NSLiteralSearch option were specified.

    Which is how I've implemented it.

  • Nick Takayama

    Nick Takayama October 16th, 2008 @ 12:47 AM

    Sorry, I see what you mean. I should specify it as nil and let it fall through to the default behavior. I'll tweak and resubmit.

  • Nick Takayama

    Nick Takayama October 16th, 2008 @ 01:49 AM

    Attaching second patch for this... now uses nil as the second argument

  • cacaodev

    cacaodev October 16th, 2008 @ 09:33 AM

    ok coolTakayama , so we agree. Now it could be interesting to work on these unimplemented options for compare:options: I think NSLitteralSearch does not apply to javascript but I need an opinion of a javascript insider. NSNumericSearch requires some scanning. I have a NSDiacriticInsensitive (10.5 innovation) partial implementation for roman alphabet that I could submit if needed.

  • Ross Boucher

    Ross Boucher October 17th, 2008 @ 11:42 AM

    Your second patch doesn't work, because it require the first. You can pass specific revisions to diff to git, so in the future, it would be best if you make sure to generate the full patch against whatever Cappuccino's HEAD is.

    For this one, I'll manually make the necessary changes.

  • Ross Boucher

    Ross Boucher October 17th, 2008 @ 11:44 AM

    • State changed from “new” to “resolved”

    Fixed here: fc9e5b3a4c67538bffb1c48fcafc9c533dbfa7b4

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Cappuccino Web Framework, including AppKit, Foundation, and Objective-J.

Shared Ticket Bins

People watching this ticket

Pages