Latest 1.0.0
Homepage https://github.com/icodebuster/JKNullReplacer
License MIT
Platforms ios 5.0, requires ARC
Authors

A NSArray and NSDictionary Category to replace NSNull values from NSArray and NSDictionary.

Adding JKNullReplacer to your project

Install via Cocoapods, add a line like the one below, in your Podfile:

pod 'JKNullReplacer', '~> 1.0.0'

Alternatively, you can clone this repository and add the files to your project

Getting Started:

Just by #import JKNullReplacer.h

For removing NSNull values from a dictionary.

[yourDictionary dictionaryWithoutNulls];

For removing NSNull values from an array.

[yourArray arrayWithoutNulls];

Dictionary Example:

NSMutableDictionary *dic1 = [NSMutableDictionary dictionary];
[dic1 setObject: @"String One" forKey: @"key1"];
[dic1 setObject: [NSNull null] forKey: @"key2"];

NSMutableDictionary *dic2 = [NSMutableDictionary dictionary];
[dic2 setObject: @"String Two" forKey: @"key4"];
[dic2 setObject: [NSNull null] forKey: @"key5"];

[dic1 setObject: dic2 forKey: @"key3"];

NSLog(@"%@", dic1);
NSLog(@"%@", [dic1 dictionaryWithoutNulls]);

License

This code is distributed under the terms and conditions of the MIT license.

Latest podspec

{
    "name": "JKNullReplacer",
    "version": "1.0.0",
    "summary": "A NSArray and NSDictionary Category to replace NSNull values from NSArray and NSDictionary.",
    "description": "                    This code is a simple Objective-C Category implemention of NSArray and NSDictionary which replaces NSNull values from NSArray and NSDictionary.n",
    "homepage": "https://github.com/icodebuster/JKNullReplacer",
    "license": "MIT",
    "authors": {
        "Jobin Kurian": "[email protected]"
    },
    "platforms": {
        "ios": "5.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/icodebuster/JKNullReplacer.git",
        "tag": "1.0.0"
    },
    "source_files": [
        "JKNullReplacer",
        "JKNullReplacer/**/*.{h,m}"
    ]
}

Pin It on Pinterest

Share This