Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am wondering how to check if all the frames of two UIImageView NSMutableArrays are equal to each other. Now I am using a NSTimer for that.

Here is the code which I use in the method:

__block BOOL equal = YES;
[Img1Array enumerateObjectsUsingBlock:^(UIImageView *ImageView1, NSUInteger idx, BOOL *stop) {
            UIImageView *ImageView2 = Img2Array[idx];
            if (!CGRectEqualToRect(ImageView1.frame, ImageView2.frame)) {

                *stop = YES;
                equal = NO;
            }
        }];
        if (equal) {
            NSLog(@"ALL THE FRAMES ARE EQUAL");
            [AllPosCorrectTimer invalidate];
        }

The method has a boolean in it as you can see. But every time the value of the 'equal' boolean is true because of the timer, so the frames are always equal to each other according to the if-statement.

How can I make sure this method will work? The function has a boolean in it as you can see. But every time the value of the 'equal' boolean is true because of the timer, so the frames are always equal to each other according to the if-statement.

How can I make sure this method will work?

share

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.