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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:49:21+00:00 2026-05-29T05:49:21+00:00

I have a Class for handling my data in my project, and now I

  • 0

I have a Class for handling my data in my project, and now I need to store the data.
I’d like to use a Plist but I’m a bit unsure of how to start.
My class is pretty simple – 6 pieces of data, flat (no hierarchy).

I want my app to start with no data, so can I assume that I should create the PList programmatically once the User creates their first piece of data? (That is, don’t create a .plist file in ‘Supporting Files’ prior to distribution?)

Then, when the app starts the next time, read the data and create an NSMUtableArray array of Class instances?

  • 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-29T05:49:21+00:00Added an answer on May 29, 2026 at 5:49 am

    To create a property list, all you need to do is use appropriate types (i.e. those that support the property list format: NSData, NSString, NSDictionary, NSNumber, NSDate, NSArray), store them in a single container, and tell the containing object to write itself to a file. To read the data, you can initialize that same type using a path. For example:

    // writing some data to a property list
    NSString *somePath = ... // replace ... with the path where you want to store the plist file
    NSMutableDictionary myDict = [NSMutableDictionary dictionary];
    [myDict setObject:@"Caleb" forKey:@"name"];
    [myDict setObject:[NSNumber numberWithInt:240] forKey:@"cholesterolOrIQ"];
    [myDict writeToFile:somePath atomically:YES];
    
    // reading the file again
    NSDictionary *readDict = [NSDictionary dictionaryWithContentsOfFile:somePath];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm unsure about the best practice for event handling/class design. I have a class
I have a singleton class which manages data and database handling of my application.
I have a couple of controllers on my site which are handling form data.
I have a GPS class which i obviously use to acquire the latitudes and
My project requires a file where I will store key/value pair data that should
I want to implement in Java a class for handling graph data structures. I
Let's assume we have a method handling operations in a tree hierarchical data structure
I have an class which should send/receive data in packet form. This class contains
I have the following code (snips provided below) in my base class for handling
I have class A, which exposes an event. an object of class B subscribed

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.