如何从 NSMutableArray 中删除 [NSNull Null] 对象?

How will I be able to remove [NSNull Null] objects from NSMutableArray?(如何从 NSMutableArray 中删除 [NSNull Null] 对象?)

本文介绍了如何从 NSMutableArray 中删除 [NSNull Null] 对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要删除由添加的 Null 对象

I need to remove Null object added by

 [mutArrSkills addObject:[NSNull null]];

我需要迭代吗?是否有任何函数可以从 NSMutableArray 中删除所有空值?

Do I need to iterate? Is there any function to remove all null values from NSMutableArray?

如果需要迭代,我该怎么做?

If need to Iterate, how will I do that?

推荐答案

你可以使用NSMutableArray的removeObjectIdenticalTo:方法,如下

You can use NSMutableArray's removeObjectIdenticalTo: method, as follows

[mutArrSkills removeObjectIdenticalTo:[NSNull null]];

删除空值.无需迭代.

这篇关于如何从 NSMutableArray 中删除 [NSNull Null] 对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何从 NSMutableArray 中删除 [NSNull Null] 对象?

基础教程推荐