• 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: Boyd Collier <email@hidden>
  • Date: Mon, 6 Aug 2007 12:03:20 -0700

You are right, of course. I didn't take the time to think it through. My apologies.

Boyd


On Aug 6, 2007, at 10:44 AM, Uli Kusterer wrote:

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


References: 
 >sortedArrayUsingFunction:context: and other variables (From: Aaron Wallis <email@hidden>)
 >Re: sortedArrayUsingFunction:context: and other variables (From: Boyd Collier <email@hidden>)
 >Re: sortedArrayUsingFunction:context: and other variables (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: dealloc for cleanup versus freeing memory
  • Next by Date: Re: NSSearchField small size
  • Previous by thread: Re: sortedArrayUsingFunction:context: and other variables
  • Next by thread: iTunes-like outline view using core data?
  • Index(es):
    • Date
    • Thread