title: Take input from text field
body: <p>I asked this question before but for some reason it says closed, but i never got the right answer,can anyone help me add a text field, where if the user types a number in text field once the number reaches the same number as the counter it displays an alert.</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  int NumberCount;
  
  @interface ViewController : UIViewController
  {
  int counter;
  IBOutlet UILabel *count;
  }
  -(IBAction)minus;
  -(IBAction)plus;
  -(IBAction)zero;
  @end
  </code></pre>
  
  <hr>
  
  <pre><code>#import "ViewController.h"
  
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  
  -(IBAction)plus {
  counter=counter + 1;
  count.text = [NSString stringWithFormat:@"%i",counter];
  }
  
  -(IBAction)minus {
  counter=counter - 1;
  count.text = [NSString stringWithFormat:@"%i",counter];
  }
  
  -(IBAction)zero {
  counter=0;
  count.text = [NSString stringWithFormat:@"%i",counter];
  }
  
  - (void)viewDidLoad {
  counter=0;
  count.text = @"0";
  [super viewDidLoad];
  
  
  // Do any additional setup after loading the view, typically from a nib.
  }
  
  
  - (void)didReceiveMemoryWarning
  {
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
  
  
  
  }
  
  @end   
  </code></pre>
  
  <hr>
  
  <p>I tried adding this in but it didn't work</p>
  
  <pre><code>if (count.text == textField ) {
      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Congrats"
                                                      message:@"You met that number"
                                                     delegate:self
                                            cancelButtonTitle:@"OK"
                                            otherButtonTitles:nil];
      [alert show];
  
  
  }
  </code></pre>
  
  <p>My ViewController.h :</p>
  
  <pre><code> __weak IBOutlet UITextField *textField;
  </code></pre>