title: iPhone Page Control only shows on the first page of a UIScrollView
body: <p>My page control only shows on the first page of the UIScrollView. Once I scroll to the next page it disappears. </p>
  
  <p>Could you tell me what I'm doing wrong? Because I'm curious as to whether I need to add a subview of the page control each time I add a subview to my UIScrollView.</p>
  
  <p>My relevant pieces of code:</p>
  
  <pre><code>-(IBAction)clickPageControl:(id)sender
  {
      int page=pageControl.currentPage;
      CGRect frame=scroller.frame;
      frame.origin.x = frame.size.width * page;
      frame.origin.y = 0;
      [scroller scrollRectToVisible:frame animated:YES];
  }
  
  -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
  {
      int page = scrollView.contentOffset.x/scrollView.frame.size.width;
      pageControl.currentPage=page;
  }
  
  - (void) viewWillAppear:(BOOL)animated
  {
      [super viewWillAppear:YES];
      arrayCount = [array count];
      scroller.delegate=self;
      scroller.pagingEnabled=YES;
      scroller.directionalLockEnabled=YES;
      scroller.showsHorizontalScrollIndicator=NO;
      scroller.showsVerticalScrollIndicator=NO;
  
      //should have an array of photo objects and the number of objects, correct?
      scrollWidth = 0;
      scroller.contentSize=CGSizeMake(arrayCount*scroller.frame.size.width, scroller.frame.size.height);
  
      for (int i = 0; i &lt; arrayCount;i++) {
          PhotoViewController *pvc = [[PhotoViewController alloc] initWithNibName:@"PhotoViewController" bundle:nil];        
          UIImageView *scrollImageView = [[UIImageView alloc] initWithFrame:CGRectOffset(scroller.bounds, scrollWidth, 0)];
          CGRect rect = scrollImageView.frame;
          pvc.view.frame  = rect;
          [pvc view];
          pvc.label.textColor = [UIColor whiteColor];
          id individualPhoto = [array objectAtIndex:i];
          NSLog(@"%@",individualPhoto);
          NSArray *keys=[individualPhoto allKeys];
          NSLog(@"%@",keys);
          NSString *imageURL=[individualPhoto objectForKey:@"source"];
          //here you can use this imageURL to get image-data and display it in imageView  
          NSURL *url = [NSURL URLWithString:imageURL];
          NSData  *data = [NSData dataWithContentsOfURL:url];
          pvc.imageView.image = [[UIImage alloc] initWithData:data];
          pvc.label.text = [NSString stringWithFormat:@"Photo Number: %i", arrayCount];
          //check to make sure the proper URL was passed
          //I have an imageView next to the UIScrollView to test whether that works - it does.
          [scroller addSubview:pvc.view];
          [scrollImageView release];
          [pvc release];
          scrollWidth += scroller.frame.size.width;
      }
  
      if (arrayCount &gt; 3) {
          pageControl.numberOfPages=3;
      } else {
      pageControl.numberOfPages=arrayCount;
      }
      pageControl.currentPage=0;
      [self.view addSubview:scroller];
  }
  </code></pre>