Latest 0.0.1
Homepage https://github.com/endSly/NullObjects
License BSD
Authors

NullObjects is a library for building Null
Objects
in Objective-C. It’s inspired by Ruby’s Naught.

Adding NullObjects to your project

CocoaPods

CocoaPods is the best way to include NullObjects in your project.

Include pod 'NullObjects', '~> 0.0.1' to your Podfile.

Usage

NONull is a replacement for NSNull but it acts more similarity to nil. It never raises an exception when method is call.

Simple Null Object


#import <NullObjects/NullObjects.h>

id null = [NONull null];

[null foo]; // == nil

Blackhole


#import <NullObjects/NullObjects.h>

id null = [NONull blackhole];

[null foo]; // == [NONull blackhole]

Replacing NSNull

Some system libraries uses NSNull for represent null object. NONull can replace NSNull object:


#import <NullObjects/NullObjects.h>

[NSNull actAsNullObject];
[NSNull actAsBlackhole];

Latest podspec

{
    "name": "NullObjects",
    "version": "0.0.1",
    "summary": "A library for building Null Objects in Objective-C.",
    "homepage": "https://github.com/endSly/NullObjects",
    "license": "BSD",
    "authors": {
        "Endika Gutiu00e9rrez Salas": "[email protected]"
    },
    "source": {
        "git": "https://github.com/endSly/NullObjects.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "NullObjects",
        "NullObjects/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This