作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何将本地路径传递给NSXMLParser
像这样
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:storePath];
其中 storepath 是这样的本地路径:
/var/mobile/Applications/56EEB906-2B73-493C-9BE7-2732440CDB69/Documents/xml1.php
我的代码是这样的:
//NSURL *urla = [[NSURL alloc] initWithString:storePath];
NSURL *urla = [[[NSURL alloc] init] fileURLWithPath:storePath];
//NSData *dataa = [NSData dataWithContentsOfURL:urla];
NSLog(@"urls ois %@",urla);
帮我看看为什么我得到空值
最佳答案
嘿,这一切都不公平。
我建议这个,非常简单
NSString *path=@"/Users/farshore/Desktop/prasanna/XMLParsing/Books-6.xml"; //this is ur path of xml file
NSURL *url = [[NSURL alloc] initFileURLWithPath:path];
关于cocoa - 如何将本地路径传递给 NSXMLParser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3146531/
我是一名优秀的程序员,十分优秀!