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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:40:01+00:00 2026-05-24T06:40:01+00:00

Im creating a application that writes strings to a plist file, but the problem

  • 0

Im creating a application that writes strings to a plist file, but the problem im having is every time its writing to the plist file, it deletes the previous one, im trying to figure out either how to write to the existing one without deleting its original contents, or replace the plist file and keep the original contents and then re write them on to it..

Heres what my code looks like to save the file

 - (NSString *) saveFilePath
 {
NSArray *pathArray =
NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

return [[pathArray objectAtIndex:0] stringByAppendingPathComponent:@"scores.plist"];

}

 -(void)alertView:(UIAlertView *)alert_view didDismissWithButtonIndex:  
(NSInteger)button_index{
if(button_index == 0){
    NSLog(@"1");
    score = 0;

}
if(button_index == 1){
    NSLog(@"2");

    NSString *scoreString = [NSString stringWithFormat:@"%i by %@", score, name.text];
    NSLog(@"%@", scoreString);
    NSArray *values = [[NSArray alloc] initWithObjects:scoreString, nil];
    [values writeToFile:[self saveFilePath] atomically:YES];
    [values release];

    score = 0;

}
}

Any ideas? Thanks!

  • 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-24T06:40:04+00:00Added an answer on May 24, 2026 at 6:40 am

    You can read the plist and write it to the NSMutableArray. Then append it with your data and write it back to the file overwriting the existing one.

    The same thing with NSMutableDictionary.

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

Sidebar

Related Questions

I'm trying to download a PDF file in Struts Action class. Problem is that
I'm creating some application that plays sounds like piano, drums etc. I have a
I'm creating an application that needs to run under multiple databases. I currently have
For an application I would like to store a collection of files together, and
I just finished up my most complex and feature-laden WinForms application to date. It
I am working on a fairly large MVC 3 application, and I'm running into
I'm currently exploring the different options for building a not-too-complex web application, in which
From what I can find online, the state of the art for Guice +
Is it possible to get an OOTB PortalSiteMapProvider to provide a site heirarchy from
I have been asked to create a graphical programming IDE for embedded 8-bit and

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.