如何通过本地路径NSXMLParser
如何通过本地路径的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);
帮助我,为什么我得到空值
感谢,但如何消除这些空间? file://localhost/Users/applefan/Library/Application%20Support/iPhone%20Simulator/3.1.3/Applications/134C5D58-D930-4F0A-B2F7-D25A170D6F09/Documents/xml1。php – ram 2010-06-30 06:32:32
); \t \t NSString * documentsDirectory = [paths objectAtIndex:0]; \t documentsDirectory = [documentsDirectory stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; \t \t NSLog(@“documentsDirectory is%@”,documentsDirectory); \t \t \t \t NSURL * urlc = [NSURL fileURLWithPath:[documentsDirectory \t \t \t \t \t \t \t \t \t \t \t stringByAppendingString:@ “/ xml1.php”]]; \t \t \t \t \t \t \t // \t urlc = [urlc stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; NSLog(@“urls is%@”,urlc); urlc仍然有这样 ILE空间plz帮助 – ram 2010-06-30 06:40:14
://localhost/Users/applefan/Library/Application%20Support/iPhone%20Simulator/3.1.3/Applications/FD5A8AF3-0B07-4D56-8477-97F0DCEF15B5/ Documents/xml1.php – ram 2010-06-30 06:41:44