14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import <Foundation/NSDictionary.h>
#import "OFNSDictionary.h"
#import "NSBridging.h"
#import "OFBridging.h"
#import "OFInitializationFailedException.h"
@implementation OFNSDictionary
- (instancetype)initWithNSDictionary: (NSDictionary *)dictionary
{
self = [super init];
@try {
if (dictionary == nil)
@throw [OFInitializationFailedException
exceptionWithClass: self.class];
_dictionary = [dictionary retain];
} @catch (id e) {
[self release];
@throw e;
}
|
>
|
|
<
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import <Foundation/NSDictionary.h>
#import "OFNSDictionary.h"
#import "OFNSEnumerator.h"
#import "NSBridging.h"
#import "OFBridging.h"
#import "OFInvalidArgumentException.h"
@implementation OFNSDictionary
- (instancetype)initWithNSDictionary: (NSDictionary *)dictionary
{
self = [super init];
@try {
if (dictionary == nil)
@throw [OFInvalidArgumentException exception];
_dictionary = [dictionary retain];
} @catch (id e) {
[self release];
@throw e;
}
|
65
66
67
68
69
70
71
72
|
return object;
}
- (size_t)count
{
return _dictionary.count;
}
@end
|
>
>
>
>
>
>
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
return object;
}
- (size_t)count
{
return _dictionary.count;
}
- (OFEnumerator *)keyEnumerator
{
return [[[OFNSEnumerator alloc]
initWithNSEnumerator: [_dictionary keyEnumerator]] autorelease];
}
@end
|