开发者

To test working of xml in iphone?

开发者 https://www.devze.com 2023-01-25 02:47 出处:网络
HI can i place both xml files and images that the xml file transports in xcode to test the working since i don\'t have the internet ? If it can be done , what should be the path name for the xml to be

HI can i place both xml files and images that the xml file transports in xcode to test the working since i don't have the internet ? If it can be done , what should be the path name for the xml to be coded i开发者_如何学编程n program and images to be typed in xml.?


NSString *stringToXML = [[NSBundle mainBundle] pathForResource:@"theXMLDoc" ofType:@"xml"];
NSURL *XMLURL = [NSURL fileURLWithPath:stringToXML];

Using that you can get XML documents from the resource folder and use them.

Just substitute your url in your code for the variable XMLURL and you should be fine. Its the same for images, you just need to make an NSURL out of the path resource.

0

精彩评论

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