This is extremely odd! Its simple stuff which is why i cannot understand. Below shows my class.
#import <UIKit/UIKit.h>
@interface LogInViewController : UIViewController
- (IBAction)loginButtonPressed:(id)sender;
@end
.
#import "LogInViewController.h"
@interface LogInViewController ()
@end
@implementation LogInViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//
- (IBAction)loginButtonPressed:(id)sender
{
NSLog(@"login Button Pressed");
}
Whenever i click the button though it throws this?!
loginButtonPressed:]: unrecognized selector sent to instance 0x15e3bf60 2013-10-28 11:23:24.249 Headache Mbl[1352:60b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSSetM loginButtonPressed:]: unrecognized selector sent to instance 0x15e3bf60' * First throw call stack:
Ive checked and the button is correctly sending the "touch up inside to loginButtonPressed:"
Help!, Thankyou:)
Here is how i attach the view controller to my main screen
import
@interface ViewController : UIViewController
@property (strong) IBOutlet UIView *loginView;
.
- (void)viewDidLoad
{
LogInViewController *logIn = [[LogInViewController alloc] initWithNibName:@"LogInViewController" bundle:nil];
[self.loginView addSubview:logIn.view];
[self.loginView setClipsToBounds:YES];
}