I’m using the following code to read an xml from my server and its working 100%
I need to read the same xml from my app bundle, so what I will change in this function to accomplish my goal?
-(void)openXML {
NSURL *url = [NSURL URLWithString:@"http://mydomain/data.xml"];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
NSURLConnection *con = [[NSURLConnection alloc] initWithRequest:req delegate:self];
con release];
myData = [[NSMutableArray alloc] init];
}
Use the
NSBundleclass to access your app’s bundled resources.