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

  • Home
  • SEARCH
  • 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 8696607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:18:45+00:00 2026-06-13T01:18:45+00:00

I have the following code: NSString *errorStr = nil; NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:dict

  • 0

I have the following code:

NSString *errorStr = nil;
NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:dict
                                                               format:NSPropertyListBinaryFormat_v1_0
                                                     errorDescription:&errorStr];
if (errorStr) {
    // Darn.
    NSLog(@"saving dictionary error %@", errorStr);
} else {
    // [plistData writeToFile:file atomically:YES];
    // (ankit): Changing this to NO for speed.
    success = [plistData writeToFile:file atomically:NO];
}

however this returns NO, for the following dictionary:

  {
    entries = (
                {
            author = "Jada Wong";
            cellIdentifier = default;
            date = "2012-10-15 02:22:41 +0000";
            domain = Readability;
            feedUrl = "readability://feed";
            imagesAreOnPulsesubscriber = 0;
            order = 0;
            summary = "";
            templateUrl = "default_template.html";
            title = "We\U2019re Going To Try Out Dolce & Gabbana\U2019s Beauty Look This Weekend";
            url = "http://www.styleite.com/media/styledish-10122012/";
        }
    );
}

but it works for the following dict:

{
    entries =     (
                {
            author = "Colleen Taylor";
            cellIdentifier = default;
            date = "2012-10-15 01:00:05 +0000";
            domain = TechCrunch;
            domainUrl = "http://techcrunch.com";
            feedUrl = "http:/asdasdm/TechCrunch";
            images =             (
                "http://asdshot-2012-10-14-at-5-20-43-pm.png"
            );
            imagesAreOnPulsesubscriber = 1;
            lastUpdated = 1350263095;
            order = 0;
            shortLink = "http://bete.me/s/ej2Tg";
            summary = "Bonobos, the men's clothing company, has gained lots of ground since it was founded in 2007 for its presence on the web as a mostly pure e-commerce p...";
            templateUrl = "default_template.html";
            title = "Inside Bonobos\U2019 New Palo Alto Digs, Where The Startup Known For E-Commerce Is Investing In Bricks & Mortar";
            url = "http://techcrunch.com/2012/10/14/bonobos-palo-alto-mike-hart/";
        }
    );
}

Any idea why? It worked for different dictionary
The file path I am writing to is:

/var/mobile/Applications/4B60A704-BE00-4160-BFB4-AD89187FADD1/Library/Caches/StoryCache/readability:  feed

The error I got is:

"The operation couldn\u2019t be completed. (Cocoa error 512.)" UserInfo=0xb41580 {NSFilePath=/var/mobile/Applications/4B60A704-BE00-4160-BFB4-AD89187FADD1/Library/Caches/StoryCache/readability:  feed, NSUnderlyingError=0xbb8930 "The operation couldn\u2019t be completed. Is a directory"}
  • 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-06-13T01:18:46+00:00Added an answer on June 13, 2026 at 1:18 am

    Use writeToFile:options:error: instead of writeToFile:atomically: so you can log the error code.

    NSError *error;
    success = [plistData writeToFile:file options:0 error:&error];
    if (!success) {
        NSLog(@"writeToFile failed with error %@", error);
    }
    

    UPDATE

    Based on the error you pasted into your question, I guess you already have a directory named /var/mobile/Applications/4B60A704-BE00-4160-BFB4-AD89187FADD1/Library/Caches/StoryCache/readability: feed. You cannot overwrite a directory with a file. You need to rename or delete the directory first. You can use -[NSFileManager removeItemAtPath:error:] to delete a directory and all of its contents recursively.

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

Sidebar

Related Questions

I have the following code: NSString *indexText = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; if (indexText==nil)
I have the following code: NSString *post = @i hope this gets there; NSData
I have the following code: .h NSString *mainString; .m case 0: case 1: case
I have the following code to open google maps: NSString *urlString = [NSString stringWithFormat:@http://maps.google.com/maps?q=%@,
Hello I have the following code: if(_deviceSegmentCntrl.selectedSegmentIndex == 0) { deviceOne = [[NSString alloc]
I have the following code: NSString *subtitle = [[[node elementsForName:@subtitle] objectAtIndex:0] stringValue]; NSString *duration
I have the following code: NSString *text = @http://bit.ly/111 http://bit.ly/222 http://www.www.www; NSRegularExpression *aLinkRegex =
How to add news via FBConnect? I have the following code: NSString *newsBody =
I have the following code in place: NSString *mapIDx = @98; NSLog(@map id: %@,
I Have the following code: -(void) changeAnimation:(NSString*)name forTime:(int) times { if(currentAnimation != @attack) {

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.