ios - NSSring from plist created from NSArray -


i create nsarray , write file: a.plist. use nsstring: initwithcontentsoffile, , can see content in xml.

then, add a.plist project , use nsstring: initwithcontentsoffile xml string.

filepath = [[nsbundle mainbundle] pathforresource:@"a" oftype:@"plist"]; nsstring *pliststr = [[nsstring alloc]initwithcontentsoffile:filepath]; 

however, failed recreate xml string. user nsarray test:

nsarray *plist2array = [[nsarray alloc]initwithcontentsoffile:filepath]; 

but successfully.

i think may result "text encoding" when add project. problem tried utf8,utf16 , on. still can't find solution.

hope help,thanks!

i find it! rename file: a.plist ->a.txt(or else), in project can xml string.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -