Closed core-design closed 2 years ago
With this option, I can now open the menu but get the error message below
//AppDelegate.m
#import "DEMOAppDelegate.h"
#import "DEMOSecondViewController.h"
#import "DEMONavigationController.h"
#import "DEMOMenuViewController.h"
#import "DEMOHomeViewController.h"
@implementation DEMOAppDelegate
- (void)applicationWillEnterForeground:(UIApplication *)application {
//APP startet wieder aus dem Hintergrund...
DEMOSecondViewController *NewsTabController=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"secondController"];
UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:NewsTabController];
DEMOMenuViewController *menuController = [[DEMOMenuViewController alloc] initWithStyle:UITableViewStylePlain];
REFrostedViewController *frostedViewController = [[REFrostedViewController alloc] initWithContentViewController:navController menuViewController:menuController];
frostedViewController.direction = REFrostedViewControllerDirectionLeft;
self.window.rootViewController = frostedViewController;
}
This is the error Message
2014-06-26 15:59:42.296 REFrostedViewControllerStoryboards[20515:60b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
Hi, I have the same problem, how did you solve it? I spent over 10 hours without any progress. Thanks.
Hi, this is my solution. Hope this helps you
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"Einsatzuebersicht"];
NavigationViewController *navController=[[NavigationViewController alloc]initWithRootViewController:vc];
MenueViewController *menuController = [[MenueViewController alloc] initWithStyle:UITableViewStylePlain];
REFrostedViewController *frostedViewController = [[REFrostedViewController alloc] initWithContentViewController:navController menuViewController:menuController];
frostedViewController.direction = REFrostedViewControllerDirectionLeft;
frostedViewController.liveBlurBackgroundStyle = REFrostedViewControllerLiveBackgroundStyleLight;
frostedViewController.liveBlur = YES;
frostedViewController.delegate = self;
self.window.rootViewController = frostedViewController;
[self.window makeKeyAndVisible];
Unfortunately, I get the same error when I run the code. Do you have other ideas or do you see something wrong in my code? Thanks a lot.
UIStoryboard` *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"homeController"];
NavigationController *navController = [[NavigationController alloc] initWithRootViewController:vc];
MenuViewController *menuController = [[MenuViewController alloc] initWithStyle:UITableViewStylePlain];
REFrostedViewController *frostedViewController = [[REFrostedViewController alloc] initWithContentViewController:navController menuViewController:menuController];
frostedViewController.direction = REFrostedViewControllerDirectionLeft;
frostedViewController.liveBlurBackgroundStyle = REFrostedViewControllerLiveBackgroundStyleLight;
frostedViewController.liveBlur = YES;
frostedViewController.delegate = self;
self.window.rootViewController = frostedViewController;
[self.window makeKeyAndVisible];
What is the Error Message?
The same error that you got in your second post
This error precisely:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]' *\ First throw call stack: (0x1812d1900 0x18093ff80 0x1811babcc 0x1811c6674 0x1000cc058 0x1860f9f38 0x1861b8018 0x186274b70 0x186282030 0x185fb5c24 0x181288588 0x18128632c 0x18128675c 0x1811b5680 0x1826c4088 0x18602cd90 0x1000da6cc 0x180d568b8) libc++abi.dylib: terminating with uncaught exception of type NSException
Thanks core-design
Evening, I just want to open a VIEW CONTROLLER from AppDelegate.
The example which I use > REFrostedViewController / Examples / storyboards /
My code:
The view controller is opened, however, I can no longer open the menu?