'Cannot execute comparison request for type: (null)' when configuring UINavigationController

My application is split into an application delegate.

The error he throws is:

Application termination due to an uncaught exception "NSInvalidArgumentException", reason: "Unable to execute a comparison request for type: (null)"

My code is below. I left the registration instructions so you can see where I checked:

self.viewController = [[ParseStarterProjectViewController alloc] initWithNibName:@"ParseStarterProjectViewController" bundle:nil]; NSLog(@"View controller is %@",self.viewController); UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.viewController]; NSLog(@"Nav controller is %@",navController); NSLog(@"Self window is %@",self.window); self.window.rootViewController = navController; 

It breaks when it tries to run this last line by setting rootViewController on navController.

The NSLog three-line results are as follows:

 View controller is <ParseStarterProjectViewController: 0x1fda0770> Nav controller is <UINavigationController: 0x1fda1390> Self window is <UIWindow: 0x1fd97c90; frame = (0 0; 320 480); opaque = NO; autoresize = RM+BM; layer = <UIWindowLayer: 0x1fd97d90>> 

It doesn't seem like something is valid to me, so I'm very confused.

+4
source share
2 answers

I just ran into this, and it happened because I was doing equalTo:[PFUser currentUser] in PFQuery, but at that moment there was no registered user.

+28
source

It really ended with the question, "how do I get more information from the crash log." Rmaddy's comment pointed me in the right direction.

Sean's answer here sorted me out.

0
source

Source: https://habr.com/ru/post/1440672/


All Articles