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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:16:11+00:00 2026-06-05T15:16:11+00:00

I am currently writing a simple IOS app that saves tasks into a table.

  • 0

I am currently writing a simple IOS app that saves tasks into a table. I wanted to expand the app and allow people to share there “lists” with other people. Before saving it to an XML or URL I wanted to try it with a local file using writeToFile:atomically:. This worked great. But I needed the file to be unique to the person using it so I wanted to make the file unique to the title of the the list. Title field is a UITextField. Tasks is a Mutable Array Here is my code:

- (void)saveTask:(id)sender;
{
NSString * original = [titleField text];
NSString * file = [NSString stringWithFormat:@"%@.plist", original];


[tasks writeToFile:@"/tmp/%@.plist",file 
        atomically:YES];
}

I get an error wanting me to add a “:” into the middle of automatically. How can I use a variable in writeToFile:atomically:? If none of this makes sense please let me know so I can add something. Thank you.

  • 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-05T15:16:12+00:00Added an answer on June 5, 2026 at 3:16 pm

    With what you’re doing, you’ll end up with file that has .plist.plist extension.

    Beside, the reason why you get an error is, the code should be like this

    [tasks writeToFile:[NSString stringWithFormat:@"/tmp/%@.plist",file] 
            atomically:YES];
    

    This might be what you wanted

    - (void)saveTask:(id)sender;
    {
        NSString * original = [titleField text];
        NSString * file = [NSString stringWithFormat:@"%@.plist", original];
    
        [tasks writeToFile:[NSString stringWithFormat:@"/tmp/%@", file] 
                atomically:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently writing an iOS app that uses a UIWebView for surfing around pages.
I am currently writing a simple, timer-based mini app in C# that performs an
I'm currently writing a simple app that performs a series of requests to the
I'm currently writing a Java app that interfaces with a MySQL database. My problem
I'm currently writing a simple FTP client (using C# and .NET). It's important that
I am currently writing an app on the Blackberry to do a simple send
I am currently writing a simple C compiler, that takes a .c file as
I'm writing simple APN toggle app. I wanted to ask how to force android
I am currently writing a simple web app which needs to update form changes
I'm currently writing a simple app to compare two lists and return differences if

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.