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
60
61
|
if (self == [OFMutableDictionary_hashtable class])
[self inheritMethodsFromClass: [OFDictionary_hashtable class]];
}
- (void)setObject: (id)object
forKey: (id)key
{
[mapTable setValue: object
forKey: key];
}
- (void)removeObjectForKey: (id)key
{
[mapTable removeValueForKey: key];
}
#ifdef OF_HAVE_BLOCKS
- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block
{
@try {
[mapTable replaceValuesUsingBlock:
^ void* (void *key, void *value, BOOL *stop) {
return block(key, value, stop);
}];
} @catch (OFEnumerationMutationException *e) {
@throw [OFEnumerationMutationException
exceptionWithClass: [self class]
object: self];
|
|
|
|
|
|
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
60
61
|
if (self == [OFMutableDictionary_hashtable class])
[self inheritMethodsFromClass: [OFDictionary_hashtable class]];
}
- (void)setObject: (id)object
forKey: (id)key
{
[_mapTable setValue: object
forKey: key];
}
- (void)removeObjectForKey: (id)key
{
[_mapTable removeValueForKey: key];
}
#ifdef OF_HAVE_BLOCKS
- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block
{
@try {
[_mapTable replaceValuesUsingBlock:
^ void* (void *key, void *value, BOOL *stop) {
return block(key, value, stop);
}];
} @catch (OFEnumerationMutationException *e) {
@throw [OFEnumerationMutationException
exceptionWithClass: [self class]
object: self];
|