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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:24:46+00:00 2026-06-01T06:24:46+00:00

For my iPhone app, I want to manage values either in NSMutableDictionary or NSMutableAarray

  • 0

For my iPhone app, I want to manage values either in NSMutableDictionary or NSMutableAarray.

I want to store rating in this format

round   player1  player2
  1        6        8
  2        7        9
--        --        --

Here in my case number of round will be fix value suppose 10, and total player would be 2 that is also fix.

But user can submit their score in any random order but in single button click. Means

 score for round  "10" for both the player   enter
 score for round  "2"  for both the player   enter

How can I manage dictionary or array which could help me in retrieving them again easily?

  • 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-01T06:24:48+00:00Added an answer on June 1, 2026 at 6:24 am
    //You can use combination of mutable array and dictionary to handle each round and player score
    
    NSMutableArray *mutArrayRound=[[NSMutableArray alloc] initWithCapacity:10];
    
    
    //--EDIT-------------------------------------------------------------------
    
    //You need to do it somewhere so that it'll not give error for [mutArrayRound insertObject: atIndex:]
    
    mutDic=[[NSMutableDictionary alloc] init];
    
    for(int i=0;i<10;i++)
    {
        [mutArrayRound addObject:mutDic];
    }
    
    [mutDic release];
    
    //-------------------------------------------------------------------------
    
    NSMutableDictionary *mutDic=[[NSMutableDictionary alloc] initWithCapacity:2];
    [mutDic setValue:@"Score_Valaue" forKey:@"player1-Score"];
    [mutDic setValue:@"Score_Valaue" forKey:@"player2-Score"];
    
    //For Round1
    [mutArrayRound insertObject:mutDic atIndex:0];
    
    //For Round2
    [mutArrayRound insertObject:mutDic atIndex:1];
    
    
    /*
        You can access for particular round using mutDic=[mutArrayRound objectAtIndex:0];
        And to access player score, you can use key score=[mutDic valueForKey:@"Player1_Score"];
     */
    
    [mutArrayRound release];
    [mutDic release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tab-based iPhone app where I want to increase the perceived start-up
I want to check if my iPhone app is running for the first time.
I want to create an iPhone app which makes calls to a web service.
I want to make a iPhone app but I need to now how you
I want to use geoJSON-formatted Data in my iPhone app. THere is a JSON
I want to create an Event Calendar for my iPhone App. In a first
I'm using FMDB for my iPhone App database and i want to create the
I want to practice Web Service Calling (both SOAP and REST) for iPhone App
I am using http communication in My iPhone app. I want to show a
I have a iPhone app and want to develop iPad app with the same

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.