-1

NSMutableArrays を含む2 つのUIImageViews があります。UIImageViews のフレームが Objective-C の他の配列のフレームと等しいかどうかを確認する方法を知りたいです。これのための機能はありますか?

4

1 に答える 1

0

配列が同じ長さであり、 と と呼ばれると仮定array1しますarray2

__block BOOL equal = YES;
[array1 enumerateObjectsUsingBlock:^(UIImageView *imageView, NSUInteger idx, BOOL *stop) {
    UIImageView *otherImageView = array2[idx];
    if (!CGRectEqualToRect(imageView.frame, otherImageView.frame))
    {
        equal = NO;
        *stop = YES;
    }
}];

if (equal) {
    // do stuff
}
于 2013-07-11T16:30:17.207 に答える