Re: Renaming files?
Re: Renaming files?
- Subject: Re: Renaming files?
- From: Clark Cox <email@hidden>
- Date: Wed, 22 Dec 2004 15:04:02 -0500
On Wed, 22 Dec 2004 20:10:02 +0100, Christoffer Lerno <email@hidden> wrote:
> I'm (among other things) using the filename as a dictionary key. Since
> the filenames are byte-wise different, isEqualToString: fails where a
> compare: would succeed, which in turn makes it impossible for me to
> retrieve the dictionary value unless I can make sure the dictionary key
> and the key I use actually do satisfy isEqualToString:
OK, now it makes sense. Just normalize the string before you use it as a key.
That is, replace calls like:
[myDictionary objectForKey: string];
[myDictionary setObject: object forKey: string];
with calls like:
[myDictionary objectForKey: [string decomposedStringWithCanonicalMapping]];
[myDictionary setObject: object forKey: [string
decomposedStringWithCanonicalMapping]];
--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden