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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:31:28+00:00 2026-05-27T09:31:28+00:00

Its only outputting one set for NSMutableDictionary not both. I want to create an

  • 0

Its only outputting one set for NSMutableDictionary not both. I want to create an JSON request using NSMutableDictionary (JSONRepresentation).

// My code    

NSArray *keysEndpoint = [NSArray arrayWithObjects:@"ID", @"Name", @"EndpointType", nil];
NSArray *objectEndpoint = [NSArray arrayWithObjects:@"622", @"Brand", @"0", nil];

NSArray *keysEndpoint1 = [NSArray arrayWithObjects:@"ID", @"Name", @"EndpointType", nil];
NSArray *objectEndpoint1 = [NSArray arrayWithObjects:@"595", @"CK-05052011", @"1", nil];

NSMutableArray *keys1 = [[NSMutableArray alloc] initWithCapacity:0];
NSMutableArray *objects1 =  [[NSMutableArray alloc] initWithCapacity:0];

[keys1 addObjectsFromArray:keysEndpoint];
[keys1 addObjectsFromArray:keysEndpoint1];

NSLog(@"Key Dic: %@", keys1);

[objects1 addObjectsFromArray:objectEndpoint];
[objects1 addObjectsFromArray:objectEndpoint1];

NSLog(@"Obje Dic: %@", objects1);

NSMutableDictionary *testMut = [NSMutableDictionary dictionaryWithObjects:objects1  forKeys:keys1];

NSLog(@"Test Dic: %@", testMut);

Output is am getting is this:

 Test Dic: {
    EndpointType = 1;
    ID = 595;
    Name = "CK-05052011";
}

Expexted output i want is :

Test Dic: {
    EndpointType = 1;
    ID = 595;
    Name = "CK-05052011";
} 
{
    EndpointType = 0;
    ID = 622;
    Name = "Brand";
}
  • 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-27T09:31:29+00:00Added an answer on May 27, 2026 at 9:31 am

    For a dictionary, adding the same keys twice will override the first set of keys. You should have a NSMutableArray of NSMutableDictionary

    NSArray *keysEndpoint = [NSArray arrayWithObjects:@"ID", @"Name", @"EndpointType", nil];
    NSArray *objectEndpoint = [NSArray arrayWithObjects:@"622", @"Brand", @"0", nil];
    
    NSArray *keysEndpoint1 = [NSArray arrayWithObjects:@"ID", @"Name", @"EndpointType", nil];
    NSArray *objectEndpoint1 = [NSArray arrayWithObjects:@"595", @"CK-05052011", @"1", nil];
    
    NSMutableDictionary *testMut = [NSMutableDictionary dictionaryWithObjects:objectsEndpoint  forKeys:keysEndpoint];
    
    
    NSMutableDictionary *testMut1 = [NSMutableDictionary dictionaryWithObjects:objectsEndpoint1  forKeys:keysEndpoint1];
    
    NSMutableArray * dictArray = [NSMutableArray arrayWithObjects:testMut,testMut1,nil];
    
    NSLog(@"Test DictArray: %@", dictArray);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think its easy to create form via only html and do not use
One recommends me the following code apparently only in .zshrc without explaining its purpose
Facebook only allows its authorization system to redirect to one URL... for me it
i have one slide panel login box with jquery and its works fine only
I m using the following loop , but its only typing the first charecter
Its only my 2nd day using this so im sorry if theres an obvious
I have a regular UITableViewController and a UITableView as its only view, and I
How do I get a vbscript to run another vbscript? Id imagine its only
When trying Edit Table Data in MySQL Workbench 5.2.37, its in read only mode.
Its a well known fact that a static method can work only on static

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.