title: iOS application crashes when button is clicked iPhone
body: <p>I am using xcode 4.2 and ARC. Below is the code I am using. When I click on any button my application crashes and it highlights this code in main.m</p>
  
  <p>Sometimes I get this error </p>
  
  <pre><code>-[__NSCFTimer parentLogin:]: unrecognized selector sent to instance
  </code></pre>
  
  <p>and sometimes application crashes without any error.</p>
  
  <pre><code>return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
  </code></pre>
  
  <p>My code is:</p>
  
  <p>In my ViewController.m I am using this code to get to the ChooseLogin view controller.</p>
  
  <pre><code>- (IBAction)action:(id)sender {
  
  
      ChooseLogin *loginScreen = [[ChooseLogin alloc] initWithNibName:@"ChooseLogin" bundle:nil];
      [UIView beginAnimations:@"flipview" context:nil];
      [UIView setAnimationDuration:2];
      [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
      [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:NO];
      [self.view addSubview:loginScreen.view];
      [UIView commitAnimations];
  }
  </code></pre>
  
  <p>Then in ChooseLogin.m:</p>
  
  <pre><code>@implementation ChooseLogin
  
  
  // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  }
  
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
      // Release any retained subviews of the main view.
      // e.g. self.myOutlet = nil;
  }
  
  - (IBAction)parentLogin:(id)sender {
  
      NSLog(@":::::::");
  
      NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
  
      NSString *passwd = [prefs stringForKey:@"password"];
  
      NSLog(@"data saved");
  
      if (passwd == nil) {
  
  
      CreatePassword *cPassword = [[CreatePassword alloc] initWithNibName:@"CreatePassword" bundle:nil ];
          [UIView beginAnimations:@"flipview" context:nil];
          [UIView setAnimationDuration:1];
          [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
          [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:NO];
          [self.view addSubview:cPassword.view];
          [UIView commitAnimations];
  
      }else {
  
          UserPassword *uPasswd = [[UserPassword alloc] initWithNibName:@"UserPassword" bundle:nil];
          [UIView beginAnimations:@"flipview" context:nil];
          [UIView setAnimationDuration:1];
          [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
          [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:NO];
          [self.view addSubview:uPasswd.view];
          [UIView commitAnimations];
  
      }
  }
  
  - (IBAction)childLogin:(id)sender {
  
      ChildLogin *loginScreen = [[ChildLogin alloc] initWithNibName:@"ChildLogin" bundle:nil];
      [UIView beginAnimations:@"flipview" context:nil];
     // [UIView setAnimationDuration:1];
      [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
      [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:NO];
      [self.view addSubview:loginScreen.view];
      [UIView commitAnimations];
  }
  
  @end
  </code></pre>