title: Several UIAlertView in one view: how to create different delegates
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9084393/multiple-uialertview-issue">multiple UIAlertView issue</a>  </p>
  </blockquote>
  
  
  
  <p>I`am beginner ios developer. And I faced with the following problem:</p>
  
  <p>In my app has one viewController with 2 UIAlertView`s. One of them has UIdatePicker, and the other has UIPickerView. In other words - they are different, with different components and various processing algorithms.</p>
  
  <p>And they must has different handlers. But I don`t know, how create different handlers with "delegate:self" on one viewController.</p>
  
  <p>I do so:</p>
  
  <pre><code>-(IBAction)alertDataPicker:(id)sender
  {
      selectPickerController *dataPicker=[[selectPickerController alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"Отмена" otherButtonTitles:@"Сохранить", nil];
      NSError *err;
      NSFetchRequest *fetch = [[NSFetchRequest alloc] initWithEntityName:@"Authors"];
      dataPicker.data = [self.context executeFetchRequest:fetch error:&amp;err];
      [dataPicker show];
  
  }
  
  -(IBAction)alertDatePicker:(id)sender
  {
      datePickerALertControllerViewController *pickerAlertView = [[datePickerALertControllerViewController alloc] initWithTitle:@" " message:@" " delegate:self cancelButtonTitle:@"Отмена" otherButtonTitles:@"Сохранить", nil];
      pickerAlertView.datePickerView.date=[self stringToDate:createDate.text];
      [pickerAlertView show];
  }
  
  #pragma mark UIAlertViewDelegate 
  - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  {
      NSLog(@"qwe");
      //NSLog(@"%@",alertView.datePickerView.date);
      //createDate.text =[self dateToString:alertView.datePickerView.date];
      //NSLog(@"date %@...%@",date,alertView.datePickerView.date);
  }
  </code></pre>
  
  <p>But xCode says that UIAlertView don`t has prorepty "datePickerView"
  - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  But if specify the class object that comes, then a similar problem arises with the properties of an object from another class.</p>
  
  <p>How I can create a different handlers to my UIAlertView`s or can determine which class of object called this method, and depending on it to go to different algorithms?</p>
  
  <p>Thanks in advance for the help and for your advice.</p>