Check if NSDictionary is Null?

后端 未结 5 1708
伪装坚强ぢ
伪装坚强ぢ 2021-02-13 07:14

I\'ve tried multiple ways. I know the dictionary is NULL, as the console also prints out when I break there. Yet when I put it in an if( ) it doesn\'t trigger.



        
5条回答
  •  鱼传尺愫
    2021-02-13 07:24

    if (TheDict == (NSDictionary*) [NSNull null]){
    
    //TheDict is null
        }
    else{
    //TheDict is not null
    
    }
    

提交回复
热议问题