I have this code: it's for 3 scroll view to have a random paging
CGRect frame = scrollView.frame;
CGRect frame1 = scrollView1.frame;
CGRect frame2 = scrollView2.frame;
frame.origin.x = frame.size.width * (arc4random() % (arrayimage.count ));
frame.origin.y = 0;
frame1.origin.x = frame.size.width * (arc4random() % (arrayimage.count ));
frame1.origin.y = 0;
frame2.origin.x = frame.size.width * (arc4random() % (arrayimage.count ));
frame2.origin.y = 0;
int pageFirst = scrollView.contentOffset.x/scrollView.frame.size.width;
int pageSecond = scrollView1.contentOffset.x/scrollView1.frame.size.width;
int pageThird = scrollView2.contentOffset.x/scrollView2.frame.size.width;
my problem is that when I launch my app nslog values for pageFisrt, pageSecond and PageThird is ever equal but paging is random and different; how can I have the correct value of pagefirst, pageSecond and pageThird?