Remove null values in an array Objective C || Remove null values in NSMutableArray SWIFT

Solution:

If you had a problem with null value in array you can easily remove the null value and change the unstable array stable array.

In Objective-C:

 [Myarray removeObjectIdenticalTo:[NSNull null]];


In Swift:

Myarray = Myarray .filter({ ($0) as AnyObject !== (NSNull()) as AnyObject })




Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift