美文网首页
面试题:找出A,BView的共同父View

面试题:找出A,BView的共同父View

作者: 常在士心 | 来源:发表于2021-05-19 09:13 被阅读0次
  • (Class)commonClass2:(Class)classA andClass:(Class)classB{
    NSArray *arr1 = [self superClasses:classA];
    NSArray *arr2 = [self superClasses:classB];
    NSSet *set = [NSSet setWithArray:arr2];
    for (NSUInteger i =0; i<arr1.count; ++i) {
    Class targetClass = arr1[i];
    if ([set containsObject:targetClass]) {
    return targetClass;
    }
    }
    return nil;
    }

相关文章

网友评论

      本文标题:面试题:找出A,BView的共同父View

      本文链接:https://www.haomeiwen.com/subject/sqwxjltx.html