I have a JSON Feed:
{
"count1" = 2;
"count2" = 2;
idval = 40;
level = "<null>";
"logo_url" = "/assets/logos/default_logo_medium.png";
name = "Golf Club";
"role_in_club" = Admin;
}
The problem is the "<null>"
that I cannot figure out how to remove from the NSDictionary before saving it to NSUserDefaults.
Please help me solve this issue. Thankyou!
I tried the solution for your question and i got it
Finally the answer is
Another variation, without (explicit) loop:
I am doing in this way.
I belive this is the most resource saving way
// category implementation on NSDictionary
Add this 3 methods in your view controller, and call this method like this way
Iterate through the dictionary and look for any null entries and remove them.
After that,
prunedDictionary
should have all non-null items in the original dictionary.