ios - Reading and writing .strings files -
reading , writing .plist files easy. .json files. there easy way reading , writing .strings files used localization? or there third party code you'd recommend purpose?
i'd love not reinvent wheel, have been unable find myself
cheers
nik
edit: this solution has been suggested, , although pleased learn there such convenient function writing , reading .strings files, looses comments. i'm looking non-lossy solution
so .strings file text file, if open plain text editor can confirm it.
so can use class method on nsstring, -stringwithcontentsoffile:
example:
nsstring *filecontents = [nsstring stringwithcontentsoffile:@"myapp.strings"]; you can use instance method -componentsseperatedbystring: if wanted split string array of lines
nsarray *lines = [filecontents componentsseparatedbystring:@"\n"];
Comments
Post a Comment