title: Passing two images to a page control
body: <p>I have a TableViewController and a DetailViewController. I put a page control in the DetailViewController and i want this page control to display two images passed from the TableViewController. The images that the page control will display depends on the cell selected in the TableViewController.</p>
  
  <p>So my problem is passing two images at the same time from the TableViewController to the page control in the DetailViewController and make the page control display the two images passed.</p>
  
  <p>PD: I want my page control to display only 2 images no more.</p>
  
  <p>Below you can see what i have been trying so far to solve my problem.  </p>
  
  <p><strong>My TableViewController.m</strong></p>
  
  <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  
      if ([segue.identifier isEqualToString:@"detailView"]) {
  
           KTDetailViewController *dvc = [segue destinationViewController];
  
           NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
  
           dvc.passedDetailImage = [UIImage imageNamed:[self.tableImgArray objectAtIndex:indexPath.row]];
  
           ***THIS IS MY ATTEMPT WHERE I PUT A ARRAY INSIDE ANOTHER***
  
           dvc.passedPagePropImg = @[ @[[UIImage imageNamed:@"receta.png"], [UIImage imageNamed:@"cachorrita1.jpg"]],
                                      @[[UIImage imageNamed:@"saiya3.jpg"], [UIImage imageNamed:@"goku.jpg"]] ];
           }
      }
  </code></pre>
  
  <p><strong>My DetailViewController.h</strong></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface KTDetailViewController : UIViewController
  
  @property (nonatomic) NSArray *passedPagePropImg;
  
  @end
  </code></pre>
  
  <p><strong>My DetailViewController.m</strong></p>
  
  <pre><code>@interface KTDetailViewController ()
  
   // Page Control
   @property (weak, nonatomic) IBOutlet UIImageView *imView;
   @property (weak, nonatomic) IBOutlet UIPageControl *pageProp;
   - (IBAction)imageChange:(UIPageControl *)sender;
  
  @end
  
  @implementation KTDetailViewController
  
  - (IBAction)imageChange:(UIPageControl *)sender {
  
      ***THIS IS MY HEADACHE WHERE MY APP CRASHES*** 
      self.imView.image = [self.passedPagePropImg objectAtIndex: self.pageProp.currentPage];
  
      [self.pageProp updateCurrentPageDisplay];
  }
  @end
  </code></pre>