-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// NSNull+NullObjects.h | ||
// NullObjects | ||
// | ||
// Created by Endika Gutiérrez Salas on 16/12/13. | ||
// Copyright (c) 2013 Endika Gutiérrez Salas. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSNull (NullObjects) | ||
|
||
+ (void)actAsNullObject; | ||
+ (void)actAsBlackhole; | ||
+ (void)actAsNullObjectWithOptions:(NSDictionary *)options; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// NSNull+NullObjects.m | ||
// NullObjects | ||
// | ||
// Created by Endika Gutiérrez Salas on 16/12/13. | ||
// Copyright (c) 2013 Endika Gutiérrez Salas. All rights reserved. | ||
// | ||
|
||
#import "NSNull+NullObjects.h" | ||
|
||
#import <objc/runtime.h> | ||
|
||
#import "NONull.h" | ||
|
||
@implementation NSNull (NullObjects) | ||
|
||
+ (void)actAsNullObject | ||
{ | ||
object_setClass([NSNull null], [NONull class]); | ||
} | ||
|
||
+ (void)actAsBlackhole | ||
{ | ||
object_setClass([NSNull null], [[NONull blackhole] class]); | ||
} | ||
|
||
+ (void)actAsNullObjectWithOptions:(NSDictionary *)options | ||
{ | ||
object_setClass([NSNull null], [NONull nullClassWithOptions:options]); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
// | ||
|
||
#import "NONull.h" | ||
#import "NSNull+NullObjects.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters