Strange problem with CFDataRef, CFHash and CFEqual
Strange problem with CFDataRef, CFHash and CFEqual
- Subject: Strange problem with CFDataRef, CFHash and CFEqual
- From: Stefan <email@hidden>
- Date: Thu, 18 Jun 2009 20:43:17 +0200
Hi,
i have some trouble with some Core funtions and are out of ideas
(after a whole day of searching, debugging and docs-reading)
The problem could be simple described:
I have 2 CGImageRef 'objects' which i have to compare.
That is working fine with the CFEqual function.
But i also need a valid (valid per contract) HashCode too.
The problem is now that these hashcodes are _always_ 0
To make this more visual i have appended a little code snipped below.
Because i really have any further ideas i need some help with this.
Much thanks in advance.
Stefan
/* SNIP */
(Yes, CoreFoundation.h is included)
CGImageRef imageRefOne;
CGImageRef imageRefTwo;
/.../
CGDataProviderRef dprov = CGImageGetDataProvider( imageRefOne );
CFDataRef imageRefOneDataRef = CGDataProviderCopyData( dprov );
/*
imageRefOneDataRef and the 2 CGImageRef's are ok, checked in XCode
debugger.
could be copied into an NSBitmapImageRep object and looks as expected
*/
CFHashCode hcOne = CFHash(imageRefOneDataRef); /* Returns ALWAYS 0 */
BOOL isEqual = CFEqual(imageRefOne, imageRefTwo); /* Works ALWAYS as
expected: if images are equal it returns equal. if not: not*/
/* SNIP */
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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