Check if NSDictionary is Null?

后端 未结 5 1725
伪装坚强ぢ
伪装坚强ぢ 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:47

    All above doesn't work for me but this

    if([mydict isKindOfClass:[NSNull class]])
    {
       NSLog("Dic is Null")
    }
    else
    {
       NSLog("Dic is Not Null")  
    }
    

    Worked for me

提交回复
热议问题