如何通過本地路徑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