Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing CFArrayEqualCallback ?




On 27 Sep 2005, at 5:54 PM, David Duncan wrote:
On Sep 27, 2005, at 03:47 PM, Markzware - Charles Ouimet wrote:

If changing the callback is not possible, what option do I have beside looping through all the strings in the array and use a string-comparison method?


CFArrayGetFirstIndexOfValue() should do what you want. The default Equal callbacks should simply call CFEqual(). Generally you only need the callbacks when your object don't contain only CoreFoundation objects.

This is not what the doc says.

From http://developer.apple.com/documentation/CoreFoundation/ Reference/CFArrayRef/Reference/chapter_2.1_section_9.html:
<quote>
The equal callback provided when theArray was created is used to compare. If the equal callback was NULL, pointer equality (in C, ==) is used.
</quote>


My CFArray only contains CFStringRef ptrs. I tried CFArrayGetFirstIndexOfValue() and didn't get the result I was expecting.

Is there a way to know wether the creator of the CFArray set a custom equal callback?

Thanx!

-C

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.