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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:11:57+00:00 2026-05-11T21:11:57+00:00

In the application that I am writing I am trying to write a list

  • 0

In the application that I am writing I am trying to write a list of fortunes for a fortune cookie out to a property list. In the simulator this works as expected and everything is great. On the iPod Touch I have it reads from said list fine but it never updates the list.

Are there any differences between updating property lists using the simulator and using the iPod Touch?

    if(indexEdit == [data count])
    {
        NSString *temp = [NSString stringWithFormat:@"%@", textField.text];
        [self.data addObject:temp];
    }
    else
    {
        NSString *temp = [NSString stringWithFormat:@"%@", textField.text];
        [data replaceObjectAtIndex:indexEdit withObject:temp];
    }
    NSString *errorDesc;
    NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Fortunes"  ofType:@"plist"];
    NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:data format:NSPropertyListXMLFormat_v1_0 errorDescription:&errorDesc];
    if (plistData)
    {
        [plistData writeToFile:bundlePath atomically:YES];
    }
    else 
    {
        NSLog(errorDesc);
        [errorDesc release];
    }
  • 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-11T21:11:58+00:00Added an answer on May 11, 2026 at 9:11 pm

    I think that your application bundle is considered to be pretty much read only. If you want to write a file you should put it in the “Documents” folder, something like:

    NSArray *savePaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSMutableString *savePath = [NSMutableString stringWithString:[savePaths objectAtIndex:0]];
    [savePath appendString:@"/Fortunes"];
    
    // blah blah
    
    [plistData writeToFile:savePath atomically:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to snoop on a log file that an application is writing
In an application that I am writing, I am getting Write Conflicts when I
I am currently trying to write an application that displays live video from a
I am trying to write a c# console application that recursively reads through a
I am trying to write a simple application that monitors the COM port and
I'm just starting out writing trying to write a simple program in C and
I am currently writing a calculator application. I am trying to write a derivative
Newbie C++ programmer here. I'm trying to write a command line application that takes
I'm writing a mapping application that I am writing in python and I need
I have a web application that I'm writing (C#, MSSQL) and I need to

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.