title: getting textfield values from customized alert view
body: <p>I have used <a href="https://github.com/wimagguc/ios-custom-alertview" rel="nofollow">this</a> to implement my <code>custom alert view</code>. To my <code>alert view</code> , I have included a <code>UITextfield</code> to input some details. My problem is how I get the input text from the alert view when the button is pressed.</p>
  
  <p>My implementation is like thisL</p>
  
  <pre><code>- (UIView *)createDemoView
  {
  
  
  UIView *demoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 290, 100)];
  
  //alertView.tag=2;
  
  UILabel *rateLbl=[[UILabel alloc]initWithFrame:CGRectMake(10, 10, 290, 45)];
  rateLbl.backgroundColor=[UIColor clearColor];
  rateLbl.font=[UIFont boldSystemFontOfSize:15];
  rateLbl.text=@"Rate";
  
  UILabel *cmntLable=[[UILabel alloc]initWithFrame:CGRectMake(10, 45, 290, 45)];
  cmntLable.backgroundColor=[UIColor clearColor];
  cmntLable.font=[UIFont boldSystemFontOfSize:15];
  cmntLable.text=@"Add Comment";
  
  UIImage *dot, *star;
  dot = [UIImage imageNamed:@"dot.png"];
  star = [UIImage imageNamed:@"star.png"];
  JSFavStarControl *rating = [[JSFavStarControl alloc] initWithLocation:CGPointMake(150, 20) dotImage:dot starImage:star];
  [rating addTarget:self action:@selector(updateRating:) forControlEvents:UIControlEventValueChanged];
  
  
  UILabel *lblAlertTItle=[[UILabel alloc]initWithFrame:CGRectMake(5, 5, 290, 45)];
  lblAlertTItle.backgroundColor=[UIColor clearColor];
  lblAlertTItle.textAlignment=NSTextAlignmentCenter;
  lblAlertTItle.font=[UIFont boldSystemFontOfSize:18];
  lblAlertTItle.text=@"Choose your sharing option";
  
  
  UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(150, 57, 100, 25)];
  text.backgroundColor=[UIColor whiteColor];
  //[demoView addSubview:lblAlertTItle];
  [demoView addSubview:text];
  [demoView addSubview:rating];
  [demoView addSubview:rateLbl];
  [demoView addSubview:cmntLable];
  
  
  return demoView;
  </code></pre>
  
  <p>}</p>
  
  <pre><code>-(void)buttonTappedDone:(cellForDatePickCell*)cell{
  
  NSString* appoinmentID =[NSString stringWithFormat:@"%@",cell.appoinment_Dtepick];
  NSString* userID = [NSString stringWithFormat:@"%@",cell.USER_Dtepick];
  
  NSDictionary* paras = [[NSDictionary alloc]initWithObjectsAndKeys:appoinmentID,@"appointmentId",userID,@"userId", nil];
  
  
  jsonpaser* jpser = [[jsonpaser alloc]init];
  //[self.indicator_process startAnimating];
  [jpser getWebServiceResponce:@"MYYURL" :paras success:^(NSDictionary *responseObject)
   {
       //requestsF_date = responseObject;
       NSLog(@"Appoinment Completed :%@",responseObject);
  
       NSString* selecteDate = [ScheduleView getDate];
  
       NSString* prsonID =[LoginView getPersonID];
  
       NSDictionary* parms = [NSDictionary dictionaryWithObjectsAndKeys:prsonID,@"caregiverPersonId",selecteDate,@"selectedDate", nil];
  
       jsonpaser* jp = [[jsonpaser alloc]init];
  
       [jp getWebServiceResponce:@"MyUrl" :parms success:^(NSDictionary *responseObject)
        {
  
            requestsF_date = responseObject;
            NSLog(@"Done Clicked :%@",requestsF_date);
           [self.tableView reloadData];
  
        }];
  
  
   }];
  
  
  
  
  // Here we need to pass a full frame
  CustomIOS7AlertView *alertView = [[CustomIOS7AlertView alloc] init];
  
  // Add some custom content to the alert view
  [alertView setContainerView:[self createDemoView]];
  
  // Modify the parameters
  [alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"OK", @"Cancel", nil]];
  [alertView setDelegate:self];
  
  // You may use a Block, rather than a delegate.
  [alertView setOnButtonTouchUpInside:^(CustomIOS7AlertView *alertView, int buttonIndex) {
      //NSLog(@"Block: Button at position %d is clicked on alertView %ld.", buttonIndex, (long)[alertView tag]);
  
      if (buttonIndex==0) {
          NSLog(@"button zero [ OK] clicked");
          // here i want to get the text box value
  
  
      }
      if (buttonIndex==1) {
           NSLog(@"button 1 [ Cancel] clicked");
  
  
      }
  
  
  
  
  
      [alertView close];
  }];
  
  [alertView setUseMotionEffects:true];
  
  // And launch the dialog
  [alertView show];
  </code></pre>
  
  <p>}</p>
  
  <p>This alert view is popes up when a button clicked in a table view row. can anyone tell me how can i take the textfield value here ?</p>
  
  <p>thank you</p>