How will I be able to remove [NSNull Null] objects from NSMutableArray?

后端 未结 5 704
南笙
南笙 2020-11-30 12:22

I need to remove Null object added by

 [mutArrSkills addObject:[NSNull null]];

Do I need to iterate? Is there any function to remove all nu

5条回答
  •  遥遥无期
    2020-11-30 13:15

    removeObjectIdenticalTo:

    Removes all occurrences of a given object in the array.

    Discussion This method uses the indexOfObjectIdenticalTo: method to locate matches and then removes them by using removeObjectAtIndex:. Thus, matches are determined using object addresses. If the array does not contain anObject, the method has no effect (although it does incur the overhead of searching the contents).

提交回复
热议问题