title: Button event is not working correctly while scrolling the page
body: <p>I have created two buttons with pagescrolling.  Now by clicking on one button the other button should be visible. How would it possible to get index of the other button when performing action method of the current button?</p>
  
  <p>Here is the code for creating the buttons:</p>
  
  <pre><code>     for (int i = 0 ; i &lt; numberOfPages ; i++)
  {
  
       pageFrame = CGRectMake(i * scrollView.bounds.size.width, 0.0f, scrollView.bounds.size.width, 416) ;
  
  
      btnSettingButton=[[UIButton alloc]initWithFrame:pageFrame ];
     [ btnSettingButton setFrame:CGRectMake(i * (scrollView.bounds.size.width)+50, 260, 20, 20)];
      btnSettingButton.tag=i;
      [btnSettingButton setImage:[UIImage imageNamed:@"Settings Icon.png"] forState:UIControlStateNormal];
  
      [scrollView addSubview:btnSettingButton];
      [btnSettingButton setHidden:YES];
    //  [btnSettingButton release];  
  
  
      UIButton  *btnCheckButton=[[UIButton alloc]initWithFrame:pageFrame ];
      [ btnCheckButton setFrame:CGRectMake(i * (scrollView.bounds.size.width)+250, 260, 20, 20)];
      [btnCheckButton setImage:[UIImage imageNamed:@"NO.png"] forState:UIControlStateNormal];
  
  
     [btnCheckButton addTarget:self action:@selector(checkBoxClicked:) forControlEvents:UIControlEventTouchUpInside];
  
    //  [btnCheckButton addTarget:self action:@selector(changePage:) forControlEvents:UIControlEventTouchUpInside];
  
  
      [scrollView addSubview:btnCheckButton];
      [btnCheckButton release];  
  </code></pre>