0

I'm trying to add the dictionaries I have in one array to another array with dictionaries so I can have one array with the dictionaries of both arrays.

I have tried this:

[arrayOne arrayByAddingObjectsFromArray:arrayTwo];

But I'm getting the following error:

-[__NSDictionaryM arrayByAddingObjectsFromArray:]: unrecognized selector sent to instance 0x75ba1a0
Juan
  • 627
  • 2
  • 9
  • 27
  • arrayOne is not an NSArray instance – wczekalski Jul 24 '13 at 16:46
  • possible duplicate of [Copying the contents of an NSMutableDictionary into another NSMutableDictionary?](http://stackoverflow.com/questions/4600386/copying-the-contents-of-an-nsmutabledictionary-into-another-nsmutabledictionary) – Matt Long Jul 24 '13 at 18:06

1 Answers1

2
- (NSArray *)arrayByAddingObjectsFromArray:(NSArray *)otherArray;

This function returns NSArray not NSDictionary, I guess in your code arrayOne is NSDictionary not NSArray right?

In Xcode source check warning shown for below line

[arrayOne arrayByAddingObjectsFromArray:arrayTwo];

To copy dictionary refer this: Copying the contents of an NSMutableDictionary into another NSMutableDictionary?

Community
  • 1
  • 1
Guru
  • 21,652
  • 10
  • 63
  • 102