0

When my app starts up I want the rootViewController to be the NavigationViewController and then I want the first screen to display my PFQueryTableViewController. I have the exact same code working on my other project, where instead of PFQueryTableViewController I have a simple TableViewController. I thought PFQueryTable worked the same as a TableViewController?

Here is the code that's giving me an error (Note: this is my AppDelegate)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[Parse setApplicationId:@"myIDisGoingInHere" clientKey:@"myClientKeyIsGoingInHere"];
[PFUser enableAutomaticUser];
PFACL *defaultACL = [PFACL ACL];
[defaultACL setPublicReadAccess:YES];
[PFACL setDefaultACL:defaultACL withAccessForCurrentUser:YES];
self.queryTableViewController = [[QueryTableViewController alloc] initWithStyle:UITableViewStylePlain];
self.navigationViewController = [[NavigationViewController alloc] initWithRootViewController:self.queryTableViewController];

self.window.rootViewController = self.navigationViewController;

self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}

Thanks for your help

Jose
  • 93
  • 7
  • This code looks good to me, but only if QueryTableViewController is a non-harmful subclass of PFQueryTable vc, and only if NavigationViewController is a non-harmful subclass of UINavigationController. To find out if its something about those custom classes, try substituting with their parents (i.e. UITableViewController and UINavigationController). – danh Sep 03 '14 at 19:32
  • Hey, thanks for the quick reply! I substituted the custom PFQueryTableViewController with UITableViewController as you suggested, and it works fine. Does that mean I have a "harmful" subclass of PFQueryTableVC? – Jose Sep 03 '14 at 19:44
  • The message its giving me is: libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) – Jose Sep 03 '14 at 19:53

0 Answers0