Trying to recognize _NSFaultingMutableSet as member of NSSet

Posted by Will on Stack Overflow See other posts from Stack Overflow or by Will
Published on 2010-05-28T02:54:19Z Indexed on 2010/05/28 3:01 UTC
Read the original article Hit count: 317

I'm trying to recognize the result of a generic query to a managed object as an NSSet. Currently the class returned is a member of _NSFaultingMutableSet, which is clearly related, but fails the isMemberOf:[NSSet class] and isKindOf:[NSSet class] calls.

Given that Cocoa doesn't do a direct implementation of NSSet, it's not surprising that I've got some air in the pipes, but I'm wondering if I'm messing something obvious up or this requires a higher grade of kung-fu than I possess.

Code follows:

SEL selector = NSSelectorFromString(someString);
 if(![self respondsToSelector:selector]){
  NSLog(@"Error processing item");
                return;
 }
 id items = [self performSelector:selector];
 Class itemsClass = [items class];
 if ( [itemsClass isKindOfClass:[NSSet class]]) {
      // do something
        }

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about inheritance