ios - Cannot determine when UIImageView frames are equal -


i have 2 layers. bottom layer consists of hidden uiimageviews, upper layer consists of visible uiimageviews. when frames of bottom layer uiimageviews equal frames of upper layer uiimageviews, have see in nslog.

the problem boolean method called nstimer returns true immediately, see nslog. want see nslog when corresponding frames equal each other.

this code:

- (void)checktheframes {     bool allequals = [self isequalframes];     if (allequals) {         nslog(@"all frames equal");         [allposcorrecttimer invalidate];     } }  -(bool)isequalframes {     for(int = 0; < arrayimg.count; i++ ){         uiimageview *imageview1 = arrayimg[i];         uiimageview *imageview2 = hiddenfieldview[i];         if (!cgrectequaltorect(imageview1.frame, imageview2.frame)) {             return no;         }     }     return yes; } 

is there way solve issue?

i think whats wrong you're comparing xs , ys too... maybe should go further frame.size , compare them. or maybe compare widths , heights (frame1.size.width == frame2.size.width)

let me know if didn't solve problem!


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -