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"];
精彩评论