My app needs many NSStrings containing differente hard coded web URLs, to be accessed according to user’s choice.
I’m looking for a convenient way to store all of these strings in one place, not being a custom Class.
I was reading about NSLocalizedString, that stores many strings on a .string file for localizations purposes, and I was wondering if I could create a custom .string file, like URLs.string.
Is that possible, to have a custom URLs.string file? If so, how to access the strings on it, like I would if it were a localized file self.titleLabel.text = NSLocalizedString(@"TITLE", nil);
Is this the best approach? Any other better idea? Thanks!
That probably isn’t the best way to do it. If you want to have some strings stored that will be distributed withe the app, use a plist file. If these are strings that are discovered (downloaded from a server, entered by a user), use NSUserDefaults.
If you want to ship some but modify them later, that can be done with a plist. Just write the modified copy in the documents dir and check for that before reading the bundle plist.