i have a loginviewcontroller class that has a button 'login'.
The login class is connected to my mainmenuviewcontroller to a uiview. This i connected as follows
(mainmenuviewcontroller.h)
import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (strong) IBOutlet UIView *loginView;
@end
(mainmenuviewcontroller.m)
- (void)viewDidLoad
{
[super viewDidLoad];
LogInViewController *logIn = [[LogInViewController alloc] initWithNibName:@"LogInViewController" bundle:nil];
[self.loginView addSubview:logIn.view];
[self.loginView setClipsToBounds:YES];
}
At this point, everything is fine. My loginViewcontroller is showing up niceley inside its own view in my main menu.
When pressing the login button on the loginviewcontroller(showing in a uiview on the main menu), it then calls the method below located in its loginviewcontroller class.
(loginviewcontroller.h)
#import <UIKit/UIKit.h>
@interface LogInViewController : UIViewController
- (IBAction)loginButtonPressed;
@end
(loginviewcontroller.m)
- (IBAction)loginButtonPressed
{
NSLog(@"login Button Pressed");
}
However an exception occurs and i dont know why: i have ensured the touchup inside sent action from the button has the correct name. And i am using Arc. HELP! :)
2013-10-28 13:57:46.367 Headache Mbl[1593:60b] -[NSConcreteMapTable loginButtonPressed]: unrecognized selector sent to instance 0x17d4fa20
2013-10-28 13:57:46.370 Headache Mbl[1593:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteMapTable loginButtonPressed]: unrecognized selector sent to instance 0x17d4fa20'
*** First throw call stack:
(0x2de2fe8b 0x385826c7 0x2de337b7 0x2de320b7 0x2dd80e98 0x305ea55f 0x305ea4fb 0x305ea4cb 0x305d60f3 0x305e9f13 0x305e9bdd 0x305e4c09 0x305b9f59 0x305b8747 0x2ddfaf27 0x2ddfa3ef 0x2ddf8bdf 0x2dd63541 0x2dd63323 0x32a742eb 0x3061a1e5 0x60bdd 0x38a7bab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I am still a quite new to this, a possible solution was suggested that the class needs to be a property. How is this done? Thanks