i do this for writeToFile my XML file :
NSURL *url = [NSURL URLWithString:loadFlux];
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];
// Load XML data from web
NSData *data = [NSData dataWithContentsOfURL:url];
// construct path within our documents directory
NSString *applicationDocumentsDir =
[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *storePath = [applicationDocumentsDir stringByAppendingPathComponent:@"flux.xml"];
// write to file atomically (using temp file)
[data writeToFile:storePath atomically:TRUE];
[prefs setValue:storePath forKey:@"CheminVersXML"];
//Initialize the delegate.
XMLToObjectParser *parser = [[XMLToObjectParser alloc] initXMLParser];
//Set delegate
[xmlParser setDelegate:parser];
//Start parsing the XML file.
BOOL success = [xmlParser parse];
if(success)
NSLog(@"No Errors");
else
NSLog(@"Error Error Error!!!");
and to load i do this :
// Load XML data from file
NSData *data = [NSData dataWithContentsOfFile:storePath];
// write to file atomically (using temp file)
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:data];
//Initialize the delegate.
XMLToObjectParser *parser = [[XMLToObjectParser alloc] initXMLParser];
//Set delegate
[xmlParser setDelegate:parser];
//Start parsing the XML file.
BOOL success = [xmlParser parse];
if(success)
NSLog(@"No Errors");
else
NSLog(@"Error Error Error!!!");
but i still have a probleme : my picture dont load (url) and my dynamic string too (guid).
Thank you for your help
EDIT : how can i do offline, the first launching is online and i need to save all data for a probably offline launch...