Reputation: 21245
I plan on bundling a number of JSON files in my app. I'd like to know if there's a limit on number of resource files on an iOS app.
Upvotes: 3
Views: 1484
Reputation: 12043
There is no limit on the files, as the functions to look up resources simply ask the file system API to look up the item in the app's directory. And that file system is using the HFS+ format, which has no practical limit on the files that it can manage inside a single directory. HFS Standard (the older format before HFS+) had a limit of 64k files per dir, IIRC, but the limit for HFS+ is 2^31, which is practically unlimited.
To add to your related question: One drawback of having 1000s of files in a dir is that it might take a while to create them all, meaning that the installation of your app may take longer than if you had the data all contained in a single file. The most effective way might be to use a container file, e.g. a zip (without compression), for which exist several iOS/ObjC libs.
Upvotes: 2