Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to parse xml file which is stored in locally iphone?
    primarykey
    data
    text
    <p>Am very new to iPhone development. I have a xml file in Resource folder, then my client will update the xml file in every day/week. I want to store the new xml file from their URL(from client) and store that new xml file in locally at the same time i need to delete the old one which is stored in Resource folder. I have followed below code, but i struggling now to retrieve the stored new xml and how to parse that new xml file.</p> <pre><code>NSArray *xmlpaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString *cachdirectory = [[NSString alloc] initWithString:[xmlpaths objectAtIndex:0]]; //first save your file from resource directory to app's cache directory NSString *path = [[NSBundle mainBundle] pathForResource:@"Directory" ofType:@"xml"]; NSData *filedata = [NSData dataWithContentsOfFile:path]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *saveName = [cachdirectory stringByAppendingPathComponent:@"NewDirectory.xml"]; [fileManager createFileAtPath:saveName contents:filedata attributes:nil]; //remove file from resource directory [fileManager removeItemAtPath:path error:nil]; //new file from internet is avilable then do following:first remove old file from cache [fileManager removeItemAtPath:cachdirectory error:nil]; //save new file from internet NSData *newfiledata=[NSData dataWithContentsOfURL:[NSURL URLWithString:UrlString]]; [fileManager createFileAtPath:savename contents:newfiledata attributes:nil]; </code></pre> <p>I have followed this code. Now am struggling how to read/Parse this new xml(From Url and saved in fileManager). Can anyone help me please? Thanks for spending your valuable time with me. Please any suggestion or any sample code to solve my problem? Once again i thank you for read my poor english. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload