开发者

How to use local xml saved in my project??

Hey the server which i am using is too slow to respond while using Maps, so i decide to ship my xml with the app and storing it locally in the app. How should i go about using it??

T开发者_StackOverflowhanks,


Use [[NSBundle mainBundle] pathForResource:@"myfile" ofType:@"xml"] to get the path. From there you can use NSData, NSString, or other classes to load the data.


You have not properly implemented the pathForResource:

NSString * string = [[NSBundle mainBundle] pathForResource"@"list-50.xml" ofType:@"xml"]; 

This is wrong.

So it should be

NSString * string = [[NSBundle mainBundle] pathForResource:@"list-50" ofType:@"xml"]; 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜