ADude
ADude

Reputation: 345

How to check if an array of dictionaries contans dictionaries in a scond array?

Hi I have two NSArrays containing NSDictionaries. I how can I check if a dictionary in array a is also in array b? I have an id key in the dictionaries.

Upvotes: 0

Views: 197

Answers (1)

Bushra Shahid
Bushra Shahid

Reputation: 3579

You can use the NSArray method containsObject: in a loop to check this Doc says:

containsObject: Returns a Boolean value that indicates whether a given object is present in the array.

  • (BOOL)containsObject:(id)anObject

Parameters anObject An object. Return Value YES if anObject is present in the array, otherwise NO.

Upvotes: 1

Related Questions