title: Going Crazy with UITextField Input in a Very Simple App
body: <p>I have a PromoCodeViewController which is triggered using the following code: </p>
  
  <pre><code>@implementation Demo_WebServiceCallingUsingiOSAppDelegate
  
  @synthesize window = _window,promoCodeController;
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  
      self.promoCodeController = [[PromoCodeViewController alloc] init]; 
  
      [self.window addSubview:self.promoCodeController.view]; 
  
      // Override point for customization after application launch.
      self.window.backgroundColor = [UIColor whiteColor];
      [self.window makeKeyAndVisible];
      return YES;
  }
  </code></pre>
  
  <p>The PromoCodeViewController contains the UITextField and I implement the UITextFieldDelegate for the PromoCodeViewController as shown: </p>
  
  <pre><code>@interface PromoCodeViewController : UIViewController&lt;UITextFieldDelegate&gt;
  
  {
      IBOutlet UITextField *promoCodeTextField; 
  }
  
  @property (nonatomic,retain) IBOutlet UITextField *promoCodeTextField; 
  
  @end
  </code></pre>
  
  <p>I implement the textFieldShouldReturn method as shown: </p>
  
  <pre><code>- (BOOL)textFieldShouldReturn:(UITextField *)textField
  {
      return TRUE; 
  }
  </code></pre>
  
  <p>I have even setup the PromoCodeViewController to be the delegate for the UITextField events. When I start typing in the TextBox it throws "Program received signal. EXC_BAD_ACCESS". It happens when I type second character in the UITextField. What am I doing wrong?</p>
  
  <p>UPDATE 1: </p>
  
  <p>The error comes on the following section: </p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      @autoreleasepool {
          return UIApplicationMain(argc, argv, nil, NSStringFromClass([Demo_WebServiceCallingUsingiOSAppDelegate class]));
      }
  }
  </code></pre>