I tried to change them into an NSSet and then make a mutable copy.
keyIds = [[[NSSet setWithArray:keyIds] array]mutableCopy];
The result is this error:
2012-09-27 19:57:36.465 BadgerNew[81030:1303] -[__NSSetI array]: unrecognized selector sent to instance 0x9f968b0
This is such a simple thing yet I do not know any direct way to do this.
The problem is that there is no method on an NSSet called array.
One way to convert an NSSet to an NSArray is to use the allObjects method:
However you will lose all ordering that you initially had with keyIds since a Set is inherently not ordered, so if that’s the case, you might be better off storing keyIds as a set in the first place.