Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove objects from NSMutable array that match with objects from another NSMutable Array

Ok so:

  • i have NSMutableArray 1
    • i also have NSMutableArray 2

I would like to remove all objects from array 1 that match with objects in array 2.

Any ideas?

like image 878
Tom G Avatar asked Nov 22 '25 08:11

Tom G


1 Answers

I've just opened the documentation, print NSMutableArray and check removing objects section...

[array1 removeObjectsInArray:array2];
like image 67
Morion Avatar answered Nov 23 '25 21:11

Morion



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!