Re: sortedArrayUsingFunction:context: and other variables
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