Coredata how to change default NSSet to NSMutableArray
NSSet
has a method allObjects
that returns NSArray
.
To get NSMutableArray
, you can do this:
NSMutableArray *array = [NSMutableArray arrayWithArray:myCoreDataObject.mySet.allObjects];
Note: the order is not guaranteed to be the same every time (sets are not ordered). If order is important to you, consider NSOrderedSet
.
See also docs on NSSet
:
PS:
The reason you are getting the error is:
NSSet
(or _NSFaultingMutableSet
for that matter) doesn't have a method called filteredArrayUsingPredicate
.
source to share