Search code examples
objective-ciosnsbundle

Download localized files from server - ios programming


For localized files, for example, localizedthis.png, the path for this file can be retrieved using

[NSBundle mainBundle] pathForResource:ofType:inDirectory:forLocalization:].

The question is, if we download the files from server and store them in "Documents" folder, is there any equivalent way to do something similar to above method?

Thanks.


Solution

  • Bundles are essentially just directories with a specific structure. So you could put the localized files that you download into a directory like Documents/MyBundle/Contents/Resources/fr.lproj/ (for French) and instead of [NSBundle mainBundle], you'd use [NSBundle bundleWithPath:...].