After a few years off the grid, I'm back programming a quick iOS application and I have to say it seems I need to get back on track. :D
I'm just trying to set-up a Login
view upon launching the application and I am stuck with the following issue on which I've read about a lot but could not fix it. Simulation stops on the main.m
(@autoreleasepool)
.
FYI: I am not using Xib or Storyboard as I'm trying to do everything programmatically.
libc++abi.dyLibL terminating with uncaught exception of type NSException
It is probably coming from one of the following.
LoginViewController.h
:
@interface LoginViewController : UIViewController
@end
Test1 / LoginViewController.m
:
I guess there should be a init
method defined from UIViewController
so I would not need to define one here.
@implementation LoginViewController
@end
Test2 / LoginViewController.m
:
Trying to override with my custom init
function. No luck as well.
@implementation LoginViewController
- (id) init
{
self = [super initWithNibName:nil bundle:nil];
return self;
}
@end
AppDelegate.m
:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
LoginViewController *loginViewController = [[LoginViewController init] alloc];
// error here
self.window.rootViewController = loginViewController;
[self.window makeKeyAndVisible];
return YES;
Not sure exactly what went wrong here but it crashes right after seeing a black iPhone screen on the simulator.
Any help appreciated! ;)
Thanks.