NSPredicate check for kind of object class

前端 未结 3 1495
梦如初夏
梦如初夏 2020-12-09 08:46

I have an array of UIView objects. I want to call - (NSArray *)filteredArrayUsingPredicate:(NSPredicate *)predicate on this array to get array of <

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 09:24

    How about using -className as your key?

    NSPredicate* foo = [NSPredicate predicateWithFormat: @"className == %@", @"MyCustomView"];
    

提交回复
热议问题