Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3616232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:28:27+00:00 2026-05-18T22:28:27+00:00

A tester said that he got this message only once, and I can’t seem

  • 0

A tester said that he got this message only once, and I can’t seem to reproduce it or figure out how this message appeared. In a nut shell, my application starts a background thread and grabs data from our server. Once we are done downloading the data we store it in an xml file, so we can grab the data from this file incase we shutdown durning the parsing of the xml. Once I am done parsing the xml I delete the file. Here is my code for deleting.

-(void)deleteSavedXmlServerData
{
    AppDelegate_Shared* appDelegate = (AppDelegate_Shared*)[[UIApplication sharedApplication] delegate];
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *fileToLoad = [NSString stringWithFormat:@"%@/%@/upload.xml", [paths objectAtIndex:0], appDelegate.userId];

   if([[NSFileManager defaultManager] fileExistsAtPath:fileToLoad] == YES)
   {

        NSError *error = nil;
        [[NSFileManager defaultManager] removeItemAtPath:fileToLoad error:&error];
        if(error != nil)
        {

             eNSLog(@"%s Error Parsing old data: %@ info: %@", __PRETTY_FUNCTION__, error, [error userInfo]);

             UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Problem With Syncing" 
                                                        message:@"Problem reading in old data." 
                                                       delegate:nil 
                                              cancelButtonTitle:@"ok" 
                                              otherButtonTitles:nil];
             [alert show];
             [alert release];
        }
    }
}

Everything seems to work perfectly, and it is not a big deal if this file does not get deleted. But I am confused why I would have an issue with deleting this file.

When I checked what the error message was this is what I got this.

 -[ServerSync deleteSavedXmlServerData] Error Parsing old data: Error Domain=NSCocoaErrorDomain Code=4 UserInfo=0x11f3ed60 "Operation could not be completed. (Cocoa error 4.)" info: {
    NSFilePath = "/var/mobile/Applications/CD181518-512F-4A0E-82ED-C438886E4A1D/Documents/71BD9A11-A604-6001-549C-DF6582F60124/upload.xml";
    NSUserStringVariant = Remove;
} 

If anyone know why if my file exist and I created it, why I cannot delete it?

Update

The question that confused me the most, is why does the first if statement say the file exist, but the error message that I get from trying to remove the file says that my file does not exist?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:28:28+00:00Added an answer on May 18, 2026 at 10:28 pm

    Reading the documentation for NSFileManager (don’t know if I just missed it the first time), it says to not use the singleton method [NSFileManager defaultManager] because NSFileManager is not thread safe. I have not had this problem since then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a call from a tester about a machine that was failing our
I've got an Adobe Flash 10 program that freezes in certain cases, however only
Bjarne Stroustrup (C++ creator) once said that he avoids "do/while" loops, and prefers to
Got a crash report from a beta tester and I'm having trouble identifying the
my company is small with only one full time tester, and mostly we're doing
How can I fix the following problem with IE6/7(IE Tester) with drop-down list(with fixed
It is said that when we handle a "click event", returning false or calling
A friend of mine said that they experienced oddities with using the decimal column
In the code for my networked game, the client receives a message that a
Mock frameworks, e.g. EasyMock, make it easier to plugin dummy dependencies. Having said that,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.