ANOTHER PROBLEM:
Even with this code: I still get the error of
"Application windows are expected to have a root view controller at the end of application launch"
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
SliderGaloreViewController *sliderGaloreViewController = [[SliderGaloreViewController alloc] init];
self.window.rootViewController = sliderGaloreViewController;
[self.window makeKeyAndVisible];
return YES;
I decided to use a storyboard rather than many XIB files now, and I have two pieces of code giving me SIGABRT errors. Could you have a look at them and indicate how to fix the errors. Thanks in advance!
UPDATE 1:
By the way, the error is:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "SliderGaloreViewController" nib but the view outlet was not set.'
Cause 1 (in appdelegate):
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
if ([prefs objectForKey:@"PuzzlePicture"] == nil) {
[prefs setBool:FALSE forKey:@"Refresh"];
[prefs setInteger:0 forKey:@"PuzzlePicture"];
[prefs setBool:TRUE forKey:@"CountMoves"];
//[prefs setBool:TRUE forKey:@"Timer"];
[prefs setInteger:1 forKey:@"PuzzleLayoutX"];
[prefs setInteger:1 forKey:@"PuzzleLayoutY"];
}
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
SliderGaloreViewController *sliderGaloreViewController = [[SliderGaloreViewController alloc] initWithNibName:@"SliderGaloreViewController" bundle:nil];
self.window.rootViewController = sliderGaloreViewController;
[self.window makeKeyAndVisible];
return YES;
}
Cause 2 (in Viewcontroller.m):
- (IBAction)showInfo:(id)sender
{
SliderGaloreFlipsideViewController *controller = [[SliderGaloreFlipsideViewController alloc] initWithNibName:@"SliderGaloreFlipsideViewController" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:controller animated:YES completion:nil];
}