27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
@implementation OFMutableMapTableDictionary
+ (void)initialize
{
if (self == [OFMutableMapTableDictionary class])
[self inheritMethodsFromClass: [OFMapTableDictionary class]];
}
- (void)setObject: (id)object
forKey: (id)key
{
[_mapTable setObject: object
forKey: key];
}
- (void)removeObjectForKey: (id)key
{
[_mapTable removeObjectForKey: key];
}
- (void)removeAllObjects
{
[_mapTable removeAllObjects];
}
#ifdef OF_HAVE_BLOCKS
- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block
{
@try {
[_mapTable replaceObjectsUsingBlock:
^ void *(void *key, void *object) {
return block(key, object);
}];
} @catch (OFEnumerationMutationException *e) {
|
|
<
|
<
|
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
@implementation OFMutableMapTableDictionary
+ (void)initialize
{
if (self == [OFMutableMapTableDictionary class])
[self inheritMethodsFromClass: [OFMapTableDictionary class]];
}
- (void)setObject: (id)object forKey: (id)key
{
[_mapTable setObject: object forKey: key];
}
- (void)removeObjectForKey: (id)key
{
[_mapTable removeObjectForKey: key];
}
- (void)removeAllObjects
{
[_mapTable removeAllObjects];
}
#ifdef OF_HAVE_BLOCKS
- (void)replaceObjectsUsingBlock: (OFDictionaryReplaceBlock)block
{
@try {
[_mapTable replaceObjectsUsingBlock:
^ void *(void *key, void *object) {
return block(key, object);
}];
} @catch (OFEnumerationMutationException *e) {
|