Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 58 lines (42 sloc) 1.38 kB
069d48a @rentzsch [CHANGE] Add MiscMerge directly to project (back in the rentzsch.com …
authored
1 //
2 // NSNull.m
3 //
4 // Written by Doug McClure
5 //
6 // Copyright 2002-2004 by Don Yacktman and Doug McClure.
7 // All rights reserved.
8 //
9 // This notice may not be removed from this source code.
10 //
11 // This header is included in the MiscKit by permission from the author
12 // and its use is governed by the MiscKit license, found in the file
13 // "License.rtf" in the MiscKit distribution. Please refer to that file
14 // for a list of all applicable permissions and restrictions.
15 //
16
17 #import "NSNull.h"
18 #import <limits.h>
19 #import <Foundation/NSString.h>
20
21 #if !HAVE_NSNULL
22
23 static NSNull *_instance;
24
25 @implementation NSNull
26
27 + (id)null
28 {
29 if ( _instance == nil )
30 _instance = [(id)NSAllocateObject([NSNull class], 0, NULL) init];
31
32 return _instance;
33 }
34
35 + (id)allocWithZone:(NSZone *)zone { return [self null]; }
36
37 - (void)dealloc {}
38
39 - (id)description { return @"<null>"; }
40
41 - (id)retain { return self; }
42 - (oneway void)release {}
43 - (id)autorelease { return self; }
44 - (unsigned)retainCount { return UINT_MAX; }
45
46 - (id)copyWithZone:(NSZone *)zone { return self; };
47 - (id)copy { return self; };
48
49 - (void)encodeWithCoder:(NSCoder *)aCoder {}
50 - (id)initWithCoder:(NSCoder *)aDecoder { return self; }
51
52 - (id)replacementObjectForCoder:(NSCoder *)aCoder { return self; }
53
54 - (id)valueForKey:(NSString *)key { return nil; }
55
56 @end
57 #endif
Something went wrong with that request. Please try again.