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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:19:37+00:00 2026-06-10T02:19:37+00:00

So my problem is that i don’t know how to update a simple txt

  • 0

So my problem is that i don’t know how to update a simple txt file. So what i have is that my app always read something from one file. Than i want to update this file with some stuf i bring down from internet. So what i can do is this:

    NSString *index2 = [documentsDirectory stringByAppendingPathComponent:@"something.txt"];
    NSURL *url = [NSURL URLWithString:@"url to file"];
    NSData *urlData = [NSData dataWithContentsOfURL:url];
    [urlData writeToFile:index2 atomically:YES];

So i downloaded the updated file and saved it to phone memory in documents Directory. But what i don’t understand is how to overwrite a file for example index1 which i have in my bundle resources.

Thanks for the replieys.

  • 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-10T02:19:39+00:00Added an answer on June 10, 2026 at 2:19 am

    You don’t want to overwrite the file that is in your bundle. What you should do is when the app starts:

    1. Check if your file is in the Documents/ (or Library/ depending on your preference) folder
    2. If it’s not there, then make a copy using the one from your bundle
    3. Then run your update and if needed, overwrite the copy you just put in Documents/

    The idea is that your bundle never changes but your app relies on the copy that you made in Documents/ so that’s the one you have to keep up to date.

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

Sidebar

Related Questions

Quick question, I have a simple javascript problem that I don't know the fix
So I have a problem that I don't really know how to go about.
i have a problem, that i don't know how to solve it. i have
I have a problem that I don't know how to solve. I have have
I have come across a problem that I don't know how to resolve involving
I have a small problem that I don't know how to deal with. I've
Let's say we have two concave 2d polygons(A, B), that don't intersect. The problem
So, one problem pattern that I keep coming across and don't have a good
I have a strange problem that I don't understand about DataPager. After changing the
I have a little problem that I don't understand. I have a db 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.