im currently parsing an xml file that is hosted on another PC via hosting a Apache http server which works fine. Now is it possible to code it in such a way that the iPhone deletes the xml file on that pc?
im currently using a NSMutableURLRequest and setting it to an NSData.
NSError * error;
NSURLResponse * response;
NSMutableURLRequest *request =
[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://ipaddress/UserBedData.xml"]
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:5.0];
[request setHTTPMethod:@"GET"];
NSData * responseData = [NSURLConnection sendSynchronousRequest:request
returningResponse:&response
error:&error];
xmlParser = [[NSXMLParser alloc] initWithData:responseData];
How much control do you have over this other server? I assume you have full access.
Consider simply cleaning the XML up periodically. Run a cron job and delete files every hour after you know they aren't needed any more. Maybe create a list on the backend that logs when data has been accessed, so that it can be safely expired.
Without further details on what you're doing, the approach is difficult to narrow down. Why can't you parse the XML on the iPhone e.g.? Can the XML feeds be generated dynamically, so there's no file to clean up? Where is the XML data coming from? This isn't necessarily a situation where posting your code is going to help. You should elaborate on how all the piece fit together (the iPhone app, the remote server, the data) and what you're trying to accomplish.
Is it even a collection of XML files? Or is it always the same one? If it's just one file, why do you need to delete it? Simply overwrite the old one when it gets regenerated (and datestamp it somewhere, so the client who downloads it knows when it's really out of date).