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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:25:26+00:00 2026-05-16T05:25:26+00:00

I am trying to create an app that has a list of users and

  • 0

I am trying to create an app that has a list of users and each user will be assigned an array of data that is editable. I am new to persistent data so i thought a property list would be the easiest to use. The first view of the app will have a list of the users that have already edited at least their name, and then have “New User” for each property list that has not yet had anything edited. (I am sure there is code to have the program create new property lists each time a person clicked on “New User” but that is probably far too difficult for me so for the time being I have just simply defined 3 property lists that will correspond with my 3 users.)

So, for the ‘viewDidLoad’ portion of my apps main screen i need to populate a UIPicker with the names of the 3 users (or “New User” if there have not been any editing). I did this:

NSString *filePathForProfile1 = [self dataForProfile1];
NSString *filePathForProfile2 = [self dataForProfile2];
NSString *filePathForProfile3 = [self dataForProfile3];


if ([[NSFileManager defaultManager] fileExistsAtPath:filePathForProfile1]) {

    NSArray *arrayProfile1 = [[NSArray alloc]initWithContentsOfFile:filePathForProfile1];
    NSArray *arrayProfile2 = [[NSArray alloc]initWithContentsOfFile:filePathForProfile2];
    NSArray *arrayProfile3 = [[NSArray alloc]initWithContentsOfFile:filePathForProfile3];

    NSArray *array = [[NSArray alloc]initWithObjects:[arrayProfile1 objectAtIndex:0],[arrayProfile2 objectAtIndex:0],[arrayProfile3 objectAtIndex:0],nil];



    self.profileData = array;
    arrayProfile1.release;
    arrayProfile2.release;
    arrayProfile3.release;
}

Now, because I have been running the program, there is already a file saved for Profile1 so the picker does display the name for that one – but for the life of me I can’t quite figure out how to have it display “New User” for the other 2. I tried to set up an if-then statement with that fileExistsAtPath argument to create init the array with “New User” but then I couldn’t pass the array out of the argument. Help Please!!

  • 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-16T05:25:27+00:00Added an answer on May 16, 2026 at 5:25 am

    I would recommend you to have a look at the Archives and Serializations Programming Guide.
    The most proper solution (well there is core data as well…) for your problem could be object serialisation.

    You probably have an array of “Person”-Objects and the Person Class has a MutableArray of “Data”-Objects.
    All you have to do then is make the Person-Class and the Data-Classe(s) NSCoding compliant. Afterwards you can easily persist your Array of Persons by something as easy as : [NSKeyedArchiver archiveRootObject:yourPersonsArray toFile:yourFilePath];

    also there is a usefull tutorial found NSCoding / NSkeyedArchiver Tutorial

    cheeers,

    sam

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

Sidebar

Related Questions

I am trying to create an android app that has the following: Theme set
I am trying to create an app that saves the user's media selections from
I'm trying to create an app that multiple users would log into a server
I am trying to create a simple app that displays a list of items
I'm trying to create a Django app where the user can make a list
I am trying to create a user form that will allow the user to
I have been trying to create a simple application that will let the user
I am trying to create an app that will help to find nearby places
I'm trying to create an app that has a set of images on screen.
I am trying to create an app that allows you to go to a

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.