Wednesday, June 19, 2013

NSMutableDictionary removeAllObjects example in Objective C (iOS).


NSMutableDictionary removeAllObjects

Empties the dictionary of its entries.

- (void)removeAllObjects

Discussion of [NSMutableDictionary removeAllObjects]
Each key and corresponding value object is sent a release message.

NSMutableDictionary removeAllObjects example.
[myDictionary removeAllObjects];
[myDictionary release];
myDictionary = [[NSMutableDictionary alloc] init];

Example of [NSMutableDictionary removeAllObjects].
NSMutableDictionary *aLocation=[[NSMutableDictionary alloc] init];
[aLocation setObject:@"26.8465108" forKey:@"lat"];
[aLocation setObject:@"80.9466832" forKey:@"long"];
[aLocation removeAllObjects]

End of NSMutableDictionary removeAllObjects example article.