title: 2 UIPickerViews each having its own UILabel to display value from NSMutableArray
body: <p>I'm having 2 UIPickerViews and two UILabels in my view and the UIPickerViews are populated with numbers from an NSMutableArray.</p>
  
  <p>The pickers need to send there chosen value to there assigned label. Example:</p>
  
  <p>_pickerView1 (selected "18")
  _pickerOutputLabel1 (shows "18")</p>
  
  <p>_pickerView2 (selected "7")
  _pickerOutputLabel2 (shows "7")</p>
  
  <p>I can't get this working, _pickerView2 also sends its value to _pickerOutputLabel1 instead of _pickerOutputLabel2.</p>
  
  <p>I've tried a couple of things but i can't figure out how to get it to work.</p>
  
  <p>This is the code (i removed my attempts to fix the issue so it atleast compiles :)</p>
  
  <p>//header file</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  
  
  @interface UIPickerViewAndLabelsViewController : UIViewController &lt;UIPickerViewDelegate, UIPickerViewDataSource&gt; {
  
  
  NSMutableArray *nrArray;
  IBOutlet UIPickerView *_pickerView1;
  IBOutlet UIPickerView *_pickerView2;
  
  UILabel *_pickerOutputLabel1;
      UILabel *_pickerOutputLabel2;
  
  }
  @property (nonatomic, retain) IBOutlet UIPickerView *pickerView1;
  @property (nonatomic, retain) IBOutlet UIPickerView *pickerView2;
  @property (nonatomic, retain) IBOutlet UILabel *pickerOutputLabel1;
  @property (nonatomic, retain) IBOutlet UILabel *pickerOutputLabel2;
  @end
  </code></pre>
  
  <p>//implementation file</p>
  
  <pre><code>#import "UIPickerViewAndLabelsViewController.h"
  
  @implementation UIPickerViewAndLabelsViewController
  
  @synthesize pickerView1 = _pickerView1;
  @synthesize pickerView2 = _pickerView2;
  @synthesize pickerOutputLabel1 = _pickerOutputLabel1;
  @synthesize pickerOutputLabel2 = _pickerOutputLabel2;
  
  /*
  // The designated initializer. Override to perform setup that is required before the view is loaded.
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  */
  
  
  // Implement loadView to create a view hierarchy programmatically, without using a nib.
  /*
  - (void)loadView {
  }
  */
  
  
  
  // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
  - (void)viewDidLoad {
  
  _pickerOutputLabel1 = [[UILabel alloc]initWithFrame:CGRectMake(400, 120, 50, 50)];
  [self.view addSubview:_pickerOutputLabel1];
  
  _pickerOutputLabel2 = [[UILabel alloc]initWithFrame:CGRectMake(400, 320, 50, 50)];
  [self.view addSubview:_pickerOutputLabel2];
  
  nrArray = [[NSMutableArray alloc] init];
  
  for (int i=0;i&lt;20+1;i++) {
  
      [nrArray addObject:[NSString stringWithFormat:@"%d", i]];
  }
  
  
  
  _pickerView1 = [[UIPickerView alloc] initWithFrame:CGRectMake(500, 120, 100, 162)];
  
  
  _pickerView1.delegate = self;
  _pickerView1.dataSource = self;
  _pickerView1.showsSelectionIndicator = YES;
  _pickerView1.transform = CGAffineTransformMakeScale(0.8, 0.8);
  [self.view addSubview:_pickerView1];
  [_pickerView1 release];
  [_pickerView1 selectRow:0 inComponent:0 animated:NO];
  
  _pickerOutputLabel1.text = [nrArray objectAtIndex:[_pickerView1 selectedRowInComponent:0]];
  
  
  _pickerView2 = [[UIPickerView alloc] initWithFrame:CGRectMake(500, 320, 100, 162)];
  
  
  _pickerView2.delegate = self;
  _pickerView2.dataSource = self;
  _pickerView2.showsSelectionIndicator = YES;
  _pickerView2.transform = CGAffineTransformMakeScale(0.8, 0.8);
  [self.view addSubview:_pickerView2];
  [_pickerView2 release];
  [_pickerView2 selectRow:0 inComponent:0 animated:NO];
  
  _pickerOutputLabel2.text = [nrArray objectAtIndex:[_pickerView2 selectedRowInComponent:0]];
  
  
      [super viewDidLoad];
  }
  
  
  
  
  
  
  
  - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)_pickerView1;
  {
      return 1;
  }
  
  
  - (void)pickerView:(UIPickerView *)_pickerView1 didSelectRow:(NSInteger)row inComponent:(NSInteger)component
  {
      _pickerOutputLabel1.text=    [nrArray objectAtIndex:row];
  }
  
  - (NSInteger)pickerView:(UIPickerView *)_pickerView1 numberOfRowsInComponent:(NSInteger)component;
  {
      return [nrArray count];
  }
  
  - (NSString *)pickerView:(UIPickerView *)_pickerView1 titleForRow:(NSInteger)row forComponent:(NSInteger)component;
  {
      return [nrArray objectAtIndex:row];
  
  }
  
  
  
  
  
  
  
  
  // Override to allow orientations other than the default portrait orientation.
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
      return YES;
  }
  
  - (void)didReceiveMemoryWarning {
      // Releases the view if it doesn't have a superview.
      [super didReceiveMemoryWarning];
  
      // Release any cached data, images, etc that aren't in use.
  }
  
  - (void)viewDidUnload {
      // Release any retained subviews of the main view.
      // e.g. self.myOutlet = nil;
  }
  
  
  - (void)dealloc {
      [super dealloc];
  }
  
  @end
  </code></pre>
  
  <p>I'm trying for 3 days and i'm stuck.</p>
  
  <p>Thanks in advance.</p>