Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
546 views
in Technique[技术] by (71.8m points)

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

I need to remove Null object added by

 [mutArrSkills addObject:[NSNull null]];

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

[mutArrSkills removeObjectIdenticalTo:[NSNull null]];

to remove the null values. No need to iterate.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...