Re: CFDictionary callback on PPC vs Intel
Re: CFDictionary callback on PPC vs Intel
- Subject: Re: CFDictionary callback on PPC vs Intel
- From: "Derrek Leute" <email@hidden>
- Date: Sun, 17 Feb 2008 11:43:41 -0500
> You declare im as an int.
>
> > CFNumberRef nmref = CFMakeCollectable(CFNumberCreate(NULL,
> > kCFNumberSInt16Type, &im));
>
> But tell CFNumber it's a signed short. The only reason it ever worked
> is by luck. Don't do that.
Wow. had to be that simple. :) So, to sum up, it wasn't setting the
value (the key was fine) because my types didn't match up. I get it.
:)
The project actually started in cocoa but I moved to CF because
NSDictionary forces a string copy for keys. This made memory needs go
through the roof (unless I'm misusing or misunderstanding how to use
it). CF lets me use anything as a key. In some sense I would love to
be in Cocoa as I had to reimplement NSSet intersection and some other
little basic things to do this. But it's fast, and it seems to be
working quite well now. Not to mention that pointer comparison also
seemed ridiculously faster on this amount of data.
Thanks so much!
>
> Since this is cocoa-dev, may I suggest using Cocoa instead of CF? As
> far as I can see you aren't taking advantage of anything CF offers
> above what Cocoa offers, and Cocoa is nicer-looking and will
> incidentally avoid this error since NSNumber takes parameters by value
> instead of by reference.
>
> Mike
> _______________________________________________
>
> 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
>
_______________________________________________
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