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

  • Home
  • SEARCH
  • 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 6843485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:15:02+00:00 2026-05-27T00:15:02+00:00

for(Attribute* attribute in appDelegate.attributeArray) { attribute = [appDelegate.attributeArray objectAtIndex:z]; attri = attribute.zName; int y

  • 0
for(Attribute* attribute in appDelegate.attributeArray) {
    attribute = [appDelegate.attributeArray objectAtIndex:z];
    attri = attribute.zName;
    int y = 0;
    for(Row* r in appDelegate.elementsArray) {
        r = [appDelegate.elementsArray objectAtIndex:y];
        NSString *ele = r.language;
        if([attri isEqualToString:ele]) {
            NSLog(@"=================+++++++++++++++++%@ %@",attri, r.user);
            [aaa insertObject:r atIndex:y]; //here i am adding the value to array
            [dict setObject:aaa forKey:attri]; //here i am adding the array to dictionary
        }
        y++;
    }
    z++;
    NSLog(@"============$$$$$$$$$$$$$$$$$$$$$$$++++++++++ %@",dict);
}

key in one array and the value in the another array and the value array is in object format.

I need to store the multi object for the single key. The attributeArray has the key value and the elementsArray has the object. For example the attributeArray might have the values

 " English, French, German..."

and the elementsArray might have the object value

"<Row: 0x4b29d40>, <Row: 0x4b497a0>, <Row: 0x4e38940>, <Row: 0x4b2a070>, <Row: 0x4b29ab0>, <Row: 0x4b178a0> "

In the first value I need to store the two object and for second key I need to store 3 objects and for the third key in need to store last two objects in the dictionary.

  • 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-27T00:15:02+00:00Added an answer on May 27, 2026 at 12:15 am

    For super-simplification you can use the following code:

    NSArray *keys = ...;
    NSArray *values = ...;
    
    NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjects: values forKeys: keys];
    

    Hope, this helps.

    UPDATE:

    to store multiple values for single key in the dictionary, just use NSArray / NSMutableArray as your object:

    NSArray *keys = ...;
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    
    for( id theKey in keys) 
    {
      NSMutableArray *item = [NSMutableArray array];
      [item addObject: ...];
      [item addObject: ...];
      ...
    
      [dict setObject: item forKey: theKey];
    }
    

    If you don’t know all the values for the key from the beginning and need to add them one by one, you can use the following approach:

    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    
    for( /*some cycling condition here */) 
    {
      id keyToUse = ...;
      id valueToAdd = ...;
    
      id foundArray = [dict objectForKey: keyToUse];
      if ( nil == foundArray )
      {
        foundArray = [NSMutableArray array];
        [dict setObject: foundArray forKey: keyToUse];
      }
    
      [foundArray addObject: valueToAdd];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CSS Attribute selectors allow the selection of elements based on attribute values. Unfortunately, I've
async=async attribute of a <script> tag in HTML, What does it mean? <script async=async
[Authorize] attribute is nice and handy MS invention, and I hope it can solve
Can an XML attribute be the empty string? In other words, is <element att=
I have a filter attribute that I'd like to be applied to every action
while writing a custom attribute in C# i was wondering if there are any
Is there a simple attribute or data contract that I can assign to a
An XML attribute declared as xs:boolean can acceptable be true, false, 0 or 1.
I have a custom attribute which can be assigned to a class, [FooAttribute] .
Can one specify XML attribute values as CDATA ? If yes - what would

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.