NSMutableArray
s を含む2 つのUIImageView
s があります。UIImageView
s のフレームが Objective-C の他の配列のフレームと等しいかどうかを確認する方法を知りたいです。これのための機能はありますか?
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 に答える