• 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
Re: sortedArrayUsingFunction:context: and other variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sortedArrayUsingFunction:context: and other variables


  • Subject: Re: sortedArrayUsingFunction:context: and other variables
  • From: Uli Kusterer <email@hidden>
  • Date: Mon, 6 Aug 2007 19:44:43 +0200

On 06.08.2007, at 19:23, Boyd Collier wrote:
Maybe I'm overlooking something very obvious, but why don't you simply change your function to something like this:

int orderWordsByUseInDictionary (NSDictionary *indexedWordsWithCounts, id tWord1, id tWord2, void * reverse )

and then make use of indexedWordsWithCounts within its body?

Won't work, that way the function has a different signature and can't be passed to sortedArrayUsingFunction:context: anymore. What he really wants to do, is pass the dictionary in the context parameter (named "reverse" in that prototype). Whatever used to be passed in context would just be added to the dictionary as well (Or you would have a dictionary that in turn contains the indexedWordsWithCounts dictionary *and* reverse, or you could use a struct containing both, or whatever). That's what the context parameter is for.


Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: sortedArrayUsingFunction:context: and other variables
      • From: Boyd Collier <email@hidden>
References: 
 >sortedArrayUsingFunction:context: and other variables (From: Aaron Wallis <email@hidden>)
 >Re: sortedArrayUsingFunction:context: and other variables (From: Boyd Collier <email@hidden>)

  • Prev by Date: Turning off sorting for one column of an NStableView
  • Next by Date: NSIndexSet incomplete?
  • Previous by thread: Re: sortedArrayUsingFunction:context: and other variables
  • Next by thread: Re: sortedArrayUsingFunction:context: and other variables
  • Index(es):
    • Date
    • Thread