How can I read, write, and check case-insensitive names in iOS?

I understand that iOS file names are case sensitive, while OSX file names may be case insensitive. The Apple iCloud Guide says:

"To make cross-platform document file format compatible, you must read and write case-sensitive files." (from http://developer.apple.com/library/ios/#documentation/General/Conceptual/iCloudDesignGuide/Chapters/DesigningForDocumentsIniCloud.html )

I want application file management not to be case sensitive in iOS. What is the correct way to work with reading and writing files, as well as checking for files (using [NSFileManager fileExistsAtPath:] ) in [NSFileManager fileExistsAtPath:] iOS, both in iCloud and in the local file system?

+4
source share
1 answer

There is no specific thing that makes iOS case insensitive. It is what it is. What they tell you is that you should not rely on case sensitivity (do not create files that differ only in case), and that you should not be sloppy using your case (do not create a "readme", but then read "Readme").

If you accept arbitrary file names from a user in iOS, and then plan to send them to iCloud, then you will need to request all the files that exist in iCloud and make sure that the conflict is case-insensitive (using [NSString caseInsensitiveCompare:] ). However, this should not increase much if you use exclusively iCloud.

+5
source

All Articles