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 6552691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:29:27+00:00 2026-05-25T12:29:27+00:00

I’ve been looking all over the site for a similar issue, but none of

  • 0

I’ve been looking all over the site for a similar issue, but none of the fixes for any of the other questions I’ve found have helped, so maybe I’m looking at it wrong or something. Anyways here is my code:

NSFileManager *fm = [[NSFileManager alloc] init];
NSError *err = nil;
NSURL *ASD =  [fm URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:&err];

if (!err) {
    NSLog(@"writing file");
    NSURL* path = [NSURL URLWithString:@"license.plist" relativeToURL:ASD];
    [dict writeToURL:path atomically:NO];
    NSString* content = [NSString stringWithContentsOfURL:path encoding:NSUTF8StringEncoding error:&err];
    if (!err) {
        NSLog(@"File:%@",content);
    }
    else
    {
        NSLog(@"Error opening file: %@",err);
    }
    return YES;
}

Given that dict is a valid Dictionary(EDIT: made the incorrect assumption that even if the file was empty it would still init the Dictionary, so added an empty init even if the file is empty), I get the following log messages:

2011-09-07 15:59:58.883 iActNow[10572:707] writing file
2011-09-07 15:59:58.889 iActNow[10572:707] Error opening file: Error
Domain=NSCocoaErrorDomain Code=260 “The operation couldn’t be
completed. (Cocoa error 260.)” UserInfo=0x4ba4d0
{NSFilePath=/var/mobile/Applications/6BA775C6-29F6-4362-8860-9ADF84598531/Library/Application
Support/license.plist, NSUnderlyingError=0x497080 “The operation
couldn’t be completed. No such file or directory”}

So for whatever reason it’s not actually writing the file. Any ideas?

  • 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-25T12:29:28+00:00Added an answer on May 25, 2026 at 12:29 pm

    I tested your code by replacing this call:

    [dict writeToURL:path atomically:NO];  
    

    with this one:

    [@"Foo" writeToURL:path atomically:NO];
    

    and file was stored properly.

    My bet is that in dict you’re holding a custom objects that NSDictionary is not capable of writing to file by definition (i.e. by Apple specs). You’ll have to probably use a different way of storing your data to a file – maybe Archives and Serializations Programming Guide can help you?

    EDIT: I’ve just noticed that you named your file “license.plist” – check out section “Reading and Writing Property-List Data” of Property List Programming Guide

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
I know there's a lot of other questions out there that deal with this
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

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.