title: Obj-c - How to convert NSMutableArray of strings into NSMutableDictionary while combining 'like' Keys and summing their Object values
body: <p><em>I am self-taught objective-c, practising and trying to learn using online courses and stack overflow. However I have hit an impasse:</em></p>
  
  <p>This array is generated by a user input submission (picking a day and providing a value). I'm currently taking these from user-defaults - Values provided are dynamic and these are examples:</p>
  
  <pre><code>NSMutableArray * arrayData;
  arrayData = (NSMutableArray *) [[defaults objectForKey:@"uploadInputs"]mutableCopy];
      // Here is an example of arrayData         
      arrayData = "10/09/2017,05","12/09/2017,24","13/09/2017,05","13/09/2017,07","13/09/2017,02"
  </code></pre>
  
  <p>I want to turn this into a dictionary with date as the key and the value for the object. When there is a like key I want to sum the values in the object. So desired output would be:</p>
  
  <pre><code>{
      "10/09/2017" = 05;
      "12/09/2017" = 24;
      "13/09/2017" = 14;
  }
  </code></pre>
  
  <p>However what I currently get is: </p>
  
  <pre><code>{
    "10/09/2017" =     (
      05
  );
    "12/09/2017" =     (
      24
  );
    "13/09/2017" =     (
      05,
      07,
      02
  );
  
  } 
  </code></pre>
  
  <p>What I have done:</p>
  
  <pre><code>  NSMutableDictionary *dictTest3 = [[NSMutableDictionary alloc] init];
      for (NSString *item in arrayData) {
  
          NSString *key = [[item componentsSeparatedByString:@","] firstObject];
          if(!dictTest3[key]){
             dictTest3[key] = [NSMutableArray new];
          }
          [dictTest3[key] addObject:[[item componentsSeparatedByString:@","] lastObject]];
      }
  NSLog(@"dictTest3: %@ ",dictTest3);
  </code></pre>
  
  <p><strong>I've attempted to follow some steps provided by CRD</strong> and simplified the code - What I'm struggling with at the moment is now summing the NSMutableArray created for having the same key.</p>
  
  <p>Can I target the NSMutableArray within the dictionary?
  Is something like this a thing?  </p>
  
  <pre><code>NSMutableArray *fuBar = ;
          NSInteger sum = 0;
          for (NSNumber *num in fuBar)
          {
              sum += [num intValue];
          }
  </code></pre>