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
Post a Comment