I have an NSArrayController which is bound to a class in my Managed Object Context. During runtime the NSArrayController can have a number of different filter predicates applied. At certain intervals, I want to iterate through my NSArrayController's contents regardless of the filter predicate applied to it.
To do this, I set the filterPredicate to nil and then reinstate it after having iterated through my array. This seems to work, but I'm wondering if it's best practice? Should I instead be polling my Managed Object Context manually?
NSPredicate *predicate = nil;
predicate = [myArrayController filterPredicate];
[myArrayController setFilterPredicate:nil];
for(MyManagedObject *object in [myArrayController arrangedObjects]) {
// ...
}
[myArrayController setFilterPredicate:predicate];