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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:27:32+00:00 2026-05-24T23:27:32+00:00

well i am storing An id of a student into a NSMUtableArray what i

  • 0

well i am storing An id of a student into a NSMUtableArray what i am trying is that to expand that array to accept two field rather than just the student id

[[NSUserDefaults standardUserDefaults] synchronize];
NSArray *archivedArray = [NSKeyedUnarchiver unarchiveObjectWithFile:[self dataFilePath]];
if (archivedArray == nil) {

    data = [[NSMutableArray alloc] init];         
} else {
    data = [[NSMutableArray alloc] initWithArray:archivedArray];
}

As you can see the data variable is only expecting one field

  • 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-24T23:27:33+00:00Added an answer on May 24, 2026 at 11:27 pm

    If I understand your question correctly, you want to have two (or more, later) fields for each “record” in the array.

    One common way to do that could be to create a dictionary with the fields you need, then add the dictionaries to the array:

    NSDictionary *student1 = [NSDictionary dictionaryWithObjectsAndKeys:
                              @"key1", @"id",
                              @"Joe", @"name",
                              nil];
    
    NSMutableArray *array = [NSMutableArray arrayWithObjects:student1, nil];
    

    Feel free to add more fields to the student record, and more students to the array. The id field of the dictionary maybe shouldn’t be a string, either, but that’ll do for a start.

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

Sidebar

Related Questions

I'm trying to write a recursive function that would get some string, as well
Well, I am storing variables inside of a class that will be used for
I'm storing some unstructured data (a keyed array) in one field of my table,
I am a student trying to finish a lab assignment. I have two files,
Well, I am wondering about a thing with rounding decimals, and storing them in
I have a query that returns a string, as well as an escape character
I've just moved to storing my sessions in a database. My PHP code uses
I'm writing a program that uses OOP to store student records. At the moment
I'm storing a number as a double . It works well with small numbers
I am student, trying to finish a homework lab. Right now I am struggling

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.