NSArray becomes NSCFArray when passed

后端 未结 3 1783
迷失自我
迷失自我 2021-01-13 14:29

I have a method that receives many different kinds of objects and decides what to do with them:

-(void)performAction:(NSObject *)myAction withItem:(Item *)my         


        
3条回答
  •  庸人自扰
    2021-01-13 15:03

    You can try using isKindOfClass: instead of isMemberOfClass:.

    The first one will return YES for objects that are either instances of the class you send, or subclasses of it, as it may be the case for NSCFArray.

提交回复
热议问题