title: Xcode objective-c error: Expected identifier
body: <p>I have a problem with my Xcode code.
  I am getting 'Expected identifier or '('' and by looking at the other posts on this topic I've probably missed something stupid, it looks like an issue with my brackets.
  This is my ViewController.m file.</p>
  
  <pre><code>#import "ViewController.h"
  #import "AppDelegate.h"
  #import &lt;UIKit/UIKit.h&gt;
  
  @interface UIViewController ()
  
  @end
  
  @implementation UIViewController
  
  @end
  
  @implementation AppDelegate.h {.  //I'm getting "Expected identifier or '('" here
  
  - (IBAction)enterPassword
  enterPassword.enabled = NO;
  
  }
  {
      NSString *passwordString = [NSString stringWithFormat:@"1234"];
      if ([passwordField.text isEqualToString:passwordString]) {
          UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Correct password" message:@"This password is correct." preferredStyle:UIAlertControllerStyleAlert];
  
  
  } else {
      UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Incorrect password" message:@"This password is incorrect." preferredStyle:UIAlertControllerStyleAlert];
      enterPassword.delegate = self;
      enterPassword.enabled = NO;
  }
  
  }
  
  @end
  </code></pre>
  
  <p>Thanks</p>
  
  <p>EDIT:
  Im getting 'Use of undeclared identifier' for my passwordField and enterPassword which are my IBOutlet and IBActions. How do I fix this? I've attached an image to show where the errors are as there is a few.
  <a href="https://i.stack.imgur.com/tacnz.png" rel="nofollow noreferrer">Image</a></p>
  
  <p>2nd EDIT:
  Added self prefix
  <a href="https://i.stack.imgur.com/wkHmu.png" rel="nofollow noreferrer">enter image description here</a>
  <a href="https://i.stack.imgur.com/d8nLO.png" rel="nofollow noreferrer">enter image description here</a></p>