How to check if an instance of NSMutableArray is null or not

前端 未结 4 1084
半阙折子戏
半阙折子戏 2020-12-30 00:20

How to check an NSMutableArray is null or not ?

4条回答
  •  别那么骄傲
    2020-12-30 00:59

    There are multiple ways to check it.

    1. if (array == [NSNull null])
      {
          //myarray is blank
      }
      
    2. if(array.count==0)
      {
          //myarray is blank
      }
      
    3. if(array == nil)
      {
          //my array is blank
      }
      

提交回复
热议问题