main
1//
2// Licensed under the terms in License.txt
3//
4// Copyright 2010 Allen Ding. All rights reserved.
5//
6
7#import "KWNull.h"
8
9@implementation KWNull
10
11#pragma mark -
12#pragma mark Initializing
13
14static KWNull *sharedNull = nil;
15
16+ (id)null {
17 if (sharedNull == nil) {
18 sharedNull = [[super allocWithZone:nil] init];
19 }
20
21 return sharedNull;
22}
23
24+ (id)allocWithZone:(NSZone *)zone {
25 return [[self null] retain];
26}
27
28- (id)copyWithZone:(NSZone *)zone {
29 return self;
30}
31
32- (id)retain {
33 return self;
34}
35
36- (NSUInteger)retainCount {
37 return NSUIntegerMax;
38}
39
40- (oneway void)release {
41}
42
43- (id)autorelease {
44 return self;
45}
46
47@end