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

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

How to check an NSMutableArray is null or not ?

4条回答
  •  再見小時候
    2020-12-30 00:51

    //if the array has a count of elements greater than 0, then the array contains elements
    if(myarray.count>0){
        NSlog(@"myarray contains values/elements");
    }
    else{ //else the array has no elements
        NSlog(@"myarray is nil");
    }
    

提交回复
热议问题