NSNumber of AppDelegate will not compare correctly

I have an NSNumber that is created in AppDelegate and contains numberWithBool:TRUE and a ViewController in which the comparison should be performed.

My problem is that the ViewController does not recognize that my NSNumber set to 1 . The debugger proves that NSNumber indeed set to 1 , but nothing happens.

 if([appDelegate.gotUrl isEqualToNumber:[NSNumber numberWithBool:TRUE]]) { //will do nothing } 

Any solutions for my problem?

Thank you in advance

+4
source share
1 answer
 if([appDelegate.gotUrl boolValue]) { // might do something } 
+5
source

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


All Articles