PDA

View Full Version : XML praser Error




Monaj
Jun 4, 2009, 01:42 AM
hi
i made an iphone application when i give the absolute path it run fine.i.e
NSURL *xmlURL = [NSURL fileURLWithPath:@"/Users/Abn/Desktop/iphoneTry/questionBank.xml"];

But when i give the relative path it did not parse the file.
NSURL *xmlURL = [NSURL fileURLWithPath:@"questionBank.xml"];

Error:-
ERROR:Operation could not be completed. (NSXMLParserErrorDomain error 5.)

In general info tab, path type is : relative to enclosing group
file type:text.xml


thanks



kainjow
Jun 4, 2009, 06:43 PM
You can't use relative paths like that, only absolute paths. Use NSSearchPathForDirectoriesInDomains() to find common folders, or NSBundle to get a file in your .app's bundle.