Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CPString compare: implementation

#109

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

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

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. cacaodev
    cacaodev

    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.

    October 16th, 2008 @ 12:17 AM

  2. Nick Takayama
    Nick Takayama

    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.

    October 16th, 2008 @ 12:42 AM

  3. Nick Takayama
    Nick Takayama

    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.

    October 16th, 2008 @ 12:47 AM

  4. Nick Takayama
    Nick Takayama

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

    October 16th, 2008 @ 01:49 AM

  5. cacaodev
    cacaodev

    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.

    October 16th, 2008 @ 09:33 AM

  6. Ross Boucher
    Ross Boucher

    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.

    October 17th, 2008 @ 11:42 AM

  7. Ross Boucher
    Ross Boucher
    • State changed from new to resolved

    Fixed here: fc9e5b3a4c67538bffb1c48fcafc9c533dbfa7b4

    October 17th, 2008 @ 11:44 AM

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.