tags:

views:

73

answers:

1

I want to create a NSURL object out of a NSString, where I use -fileURLWithPath:(NSString ) I put my xml file as my source file, and name it event.xml. But NSString URL = @"event.xml"; NSURL a = [NSURL fileURLWithPath:URL];

but then my xmlparser return a connection failed error.

so what's the correct way to specify the path of a xml in the source file?

sorry about the formatting but I'm really in a rush

+1  A: 

That depends on the directory your XML file is in. If we are talking about a file in your app bundle, it is:

NSString *path = [[NSBundle mainBundle] pathForResource:@"event" ofType:@"xml"];
Ole Begemann