title: How to pass array form one view to another view in iphone
body: <p>I am new to i phone programming.I have store some data in array that i want to pass that array data form one view to another view.What i am tried but its not working.Can any body tell me what is mistake in that.</p>
  
  <p>#import"firstviewcontroller.h"</p>
  
  <pre><code> @property(nonatomic,retain)NSMutableArray *tapCollection;
   @property(nonatomic,retain)NSMutableArray *imageCollection;
  </code></pre>
  
  <p>#import"firstviewcontroller.m"</p>
  
  <pre><code>   @synthesize imageCollection,tapCollection;
      -(void)viewdidload
      {
      self.tapCollection = [[NSMutableArray alloc] init];
      self.imageCollection = [[NSMutableArray alloc] init];
      }
      - (void)insertNewObject:(id)sender
      {
  
          secondviewcontroller*r= [[secondviewcontrolleralloc] initWithNibName:@"secondviewcontroller" bundle:nil];
          self.navigationController.navigationBar.tintColor=[UIColor blackColor];
           r.imageCollection1 =imageCollection;
               r.tapCollection1 =tapCollection;
          [self.navigationController pushViewController:r animated:YES];
  
      }
  </code></pre>
  
  <p>Acctually what data i store in array is images and button tag values.Here in console its displaying  Images and button tag value i have store in array</p>
  
  <pre><code>2013-03-19 21:54:03.374 Taukyy[290:1c103] (
      0,
      "&lt;UIImage: 0x9cd59e0&gt;",
      1,
      "&lt;UIImage: 0x9cd6220&gt;",
      2,
      "&lt;UIImage: 0x9cd6b70&gt;"
  )
  </code></pre>
  
  <h1>import"secondviewcontroller.h"</h1>
  
  <pre><code>@property(nonatomic,retain)NSMutableArray *tapCollection1;
  @property(nonatomic,retain)NSMutableArray *imageCollection1;
  </code></pre>
  
  <h1>import"secondviewcontroller.m"</h1>
  
  <pre><code>@synthesize tapCollection1,imageCollection1;
  - (void)viewDidLoad
  {
      imageCollection1 = [[NSMutableArray alloc] init];
     tapCollection1 = [[NSMutableArray alloc] init];
     NSLog(@"%@",tapCollection1);
     NSLog(@"%@",imageCollection1);
  }
  </code></pre>
  
  <p>But here values are not displaying.Its showing as below</p>
  
  <pre><code>2013-03-19 21:29:16.379 Taukyy[594:1c103] (
  )
  2013-03-19 21:29:16.380 Taukyy[594:1c103] (
  )
  2013-03-19 21:29:16.381 Taukyy[594:1c103] (
  )
  </code></pre>
  
  <p>Please can any body tell me what is mistake in this code
  Thanks
  Aslam</p>