> Thanks. The distance is computed because the entry string is dynamic and it's > providing a distance between the title of the song and what was entered as > text. So I can't pre-compute that data and stuff into a dictionary. Each time > the method is called, the stringValue will be different.
Yep, I understand. What you do is that for each entry string you compute the hash key (which is fast, as it is only a sum of chars), and you select the key which is the nearest to your dynamic key. You can do that on the fly. Somehow, if you want to compare only strings of the same length, you have to rely on a two level dictionary, or make your key special (e.g. the upper byte contains the string length, the lower bytes are the hash key). Vincent_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com