Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy do i get an exception with an Array on device but not in simulator?
    primarykey
    data
    text
    <p>'NSInvalidArgumentException', reason: '-[__NSCFSet addObject:]: attempt to insert nil'</p> <p>Why do i get this exception in iPhone 5.1 and not in the 6.0 simulator when i run the code below? This code is for a slide view controller is this supported in 5.1?</p> <pre><code>- (NSArray*)controllers { NSMutableArray *result = [NSMutableArray array]; if (self.centerController) [result addObject:self.centerController]; if (self.leftController) [result addObject:self.leftController]; if (self.rightController) [result addObject:self.rightController]; if (self.topController) [result addObject:self.topController]; if (self.bottomController) [result addObject:self.bottomController]; return [NSArray arrayWithArray:result]; } </code></pre> <p>I think this is what Kevin is looking for.</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; IIViewDeckController* deckController = [self generateControllerStack]; self.leftController = deckController.leftController; self.centerController = deckController.centerController; /* To adjust speed of open/close animations, set either of these two properties. */ // deckController.openSlideAnimationDuration = 0.15f; // deckController.closeSlideAnimationDuration = 0.5f; self.window.rootViewController = deckController; [self.window makeKeyAndVisible]; return YES; } - (IIViewDeckController*)generateControllerStack { LeftViewController* leftController = [[LeftViewController alloc] initWithNibName:@"LeftViewController" bundle:nil]; RightViewController* rightController = [[RightViewController alloc] initWithNibName:@"RightViewController" bundle:nil]; UIViewController *centerController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; centerController = [[UINavigationController alloc] initWithRootViewController:centerController]; IIViewDeckController* deckController = [[IIViewDeckController alloc] initWithCenterViewController:centerController leftViewController:leftController rightViewController:rightController]; deckController.rightSize = 100; [deckController disablePanOverViewsOfClass:NSClassFromString(@"_UITableViewHeaderFooterContentView")]; return deckController; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload