Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove multiple elements in a NSMutableSet?

We can remove multiple elements from NSMutableArray by using removeObjectsInArray: function. Does NSMutableSet have any similar function?

like image 294
FlySoFast Avatar asked Oct 10 '15 01:10

FlySoFast


1 Answers

You can use minusSet: method to remove multiple elements from your mutable set, like this:

NSMutableSet *mySet = ...
[mySet minusSet:[NSSet setWithArray:myArray]];
like image 184
Sergey Kalinichenko Avatar answered Sep 19 '22 06:09

Sergey Kalinichenko