请注意以下方法,因为我正在崩溃
+ (NSArray*) controllersByTitle:(NSString*)title andNavigationController:(UINavigationController*)navController andSideBarController:(SP2SideBarViewController *)sidebarViewController {
if ( [title isEqualToString:NSLocalizedString(@"****", @"****")] ) {
**** *controller;
controller = ([[[navController viewControllers] objectAtIndex:0] isKindOfClass:[**** class]]) ? ([[navController viewControllers] objectAtIndex:0]) : ([[[**** alloc] initWithStyle:UITableViewStyleGrouped] autorelease]);
controller.leftSidebarViewController = sidebarViewController;
sidebarViewController.sidebarDelegate = controller;
return [NSArray arrayWithObject:controller];
}
else if ( [title isEqualToString:NSLocalizedString(@"****", @"****")] ) {
**** *controller;
controller = ([[[navController viewControllers] lastObject] isKindOfClass:[**** class]]) ? ([[navController viewControllers] lastObject]) : ([[[**** alloc] init] autorelease]);
controller.leftSidebarViewController = sidebarViewController;
sidebarViewController.sidebarDelegate = controller;
return [NSArray arrayWithObject:controller];
}
else if ( [title isEqualToString:NSLocalizedString(@"****", @"****")] ) {
**** *controller;
controller = ([[[navController viewControllers] lastObject] isKindOfClass:[**** class]]) ? ([[navController viewControllers] lastObject]) : ([[[**** alloc] init] autorelease]);
controller.leftSidebarViewController = sidebarViewController;
sidebarViewController.sidebarDelegate = controller;
return [NSArray arrayWithObject:controller];
}
else if ([title isEqualToString:NSLocalizedString(@"****", @"****")] || [title isEqualToString:NSLocalizedString(@"****", @"****")]) {
UsersViewController *controller;
controller = ([[[navController viewControllers] lastObject] isKindOfClass:[UsersViewController class]]) ? ([[navController viewControllers] lastObject]) : ([[[UsersViewController alloc] init] autorelease]);
controller.leftSidebarViewController = sidebarViewController;
sidebarViewController.sidebarDelegate = controller;
[controller setTitle:title];
if ( [title isEqualToString:NSLocalizedString(@"****", @"****")] )
controller.runMode = ****;
else
controller.runMode = ****;
[[GAI sharedInstance].defaultTracker sendView:title];
[controller.tableView reloadData];
return [NSArray arrayWithObject:controller];
}
else if ( [title isEqualToString:NSLocalizedString([NSString stringWithFormat:@"****"], @"****")] ) {
**** *controller;
controller = ([[[navController viewControllers] lastObject] isKindOfClass:[**** class]]) ? ([[navController viewControllers] lastObject]) : ([[[**** alloc] init] autorelease]);
controller.leftSidebarViewController = sidebarViewController;
sidebarViewController.sidebarDelegate = controller;
return [NSArray arrayWithObject:controller];
}
else if ( [title isEqualToString:NSLocalizedString( [NSString stringWithFormat:@"****"], @"****")] ) {
**** *controller;
controller = ([[[navController viewControllers] lastObject] isKindOfClass:[**** class]]) ? ([[navController viewControllers] lastObject]) : ([[[RDATagCloudController alloc] init] autorelease]);
controller.leftSidebarViewController = sidebarViewController;
sidebarViewController.sidebarDelegate = controller;
return [NSArray arrayWithObject:controller];
}
else if ( [title isEqualToString:@"Crash Me"] ) {
CFRelease(NULL);
}
SP2DecksViewController *controller;
controller = ([[[navController viewControllers] objectAtIndex:0] isKindOfClass:[SP2DecksViewController class]]) ? ([[navController viewControllers] objectAtIndex:0]) : ([[[SP2DecksViewController alloc] init] autorelease]);
controller.leftSidebarViewController = sidebarViewController;
sidebarViewController.sidebarDelegate = controller;
controller.runMode = ([title isEqualToString:NSLocalizedString(@"****", @"****")]) ? **** : OtherApplication;
[controller showReloadButtonByRunMode:controller.runMode];
[controller setTitle:title];
//[controller.tableView reloadData];
[[GAI sharedInstance].defaultTracker sendView:title];
return [NSArray arrayWithObject:controller];
}
控制台输出
- [SettingsTableViewController sidebarViewController:didSelectObject:atIndexPath:]:发送到解除分配的实例0xa52fd80的消息