iOS:Bug-isEqual

@implementation Base

- (BOOL)isEqual:(id)object {
    return [object isKindOfClass:[self class]];
}

@end

@interface Child : Base

@end

int main(){
    NSArray *arrChilds;
    Base *b = [[Base alloc] init];
    BOOL boo1 = [arrChilds containsObject:b];
    for (Child *child in arrChilds) {
        boo1 = [child isEqual:b]; ;
    }
}

你可能感兴趣的:(iOS:Bug-isEqual)