gpt4 book ai didi

cocoa - 如何将本地路径传递给 NSXMLParser

转载 作者:行者123 更新时间:2023-12-03 18:04:53 26 4
gpt4 key购买 nike

如何将本地路径传递给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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com