27 lines · c
1@protocol P @end2 3@interface NSMutableArray4- (id)objectAtIndexedSubscript:(unsigned int)index;5- (void)setObject:(id)object atIndexedSubscript:(unsigned int)index;6@end7 8@interface NSMutableDictionary9- (id)objectForKeyedSubscript:(id)key;10- (void)setObject:(id)object forKeyedSubscript:(id)key;11@end12 13void all(void) {14 NSMutableArray *array;15 id oldObject = array[10];16 17 array[10] = oldObject;18 19 NSMutableDictionary *dictionary;20 id key;21 id newObject;22 oldObject = dictionary[key];23 24 dictionary[key] = newObject;25}26 27