i have array of birthdates as array is getting filled from facebook so there are some friends whos birthdates are private so it contain NULL how to convert that array like empty string wherever there is null value the array is like below
"<null>",
"10/29/1988",
"11/13",
"03/24/1987",
"04/25/1990",
"03/13",
"01/01",
"<null>",
"12/15/1905",
"07/10",
"11/02/1990",
"12/30/1990",
"<null>",
"07/22/1990",
"01/01",
"07/17/1989",
"08/28/1990",
"01/10/1990",
"06/12/1990",
You have to use this to remove the actual [NSNull null] value.
The
null
values appear to be string literals@"<null>"
rather than theNSNull
objects typically used to representnil
s in Cocoa collections. You can filter them out by usingNSArray
'sfilteredArrayUsingPredicate
method:There are several ways of making the
pred
, one of them isThis works for me:
For json response I removed null values like this
Now remove empty values
//Add arrays to mutable array to remove empty objects
In order to remove null values use :
You don't need iterate over.