15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
*/
#import "NSDictionary_OFDictionary.h"
#import "OFDictionary.h"
#import "NSBridging.h"
#import "OFBridging.h"
@implementation NSDictionary_OFDictionary
- initWithOFDictionary: (OFDictionary*)dictionary_
{
if ((self = [super init]) != nil) {
@try {
dictionary = [dictionary_ retain];
|
>
>
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
*/
#import "NSDictionary_OFDictionary.h"
#import "OFDictionary.h"
#import "NSBridging.h"
#import "OFBridging.h"
#import "OFOutOfRangeException.h"
@implementation NSDictionary_OFDictionary
- initWithOFDictionary: (OFDictionary*)dictionary_
{
if ((self = [super init]) != nil) {
@try {
dictionary = [dictionary_ retain];
|
45
46
47
48
49
50
51
52
53
54
55
56
|
if ([object conformsToProtocol: @protocol(OFBridging)])
return [object NSObject];
return object;
}
- (size_t)count
{
return [dictionary count];
}
@end
|
|
|
|
>
>
>
>
>
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
if ([object conformsToProtocol: @protocol(OFBridging)])
return [object NSObject];
return object;
}
- (NSUInteger)count
{
size_t count = [dictionary count];
if (count > NSUIntegerMax)
@throw [OFOutOfRangeException exceptionWithClass: [self class]];
return (NSUInteger)count;
}
@end
|