Somewhere in an ARC project, I have:
//Class1.h
@interface Class1 {
NSDictionary * dict;
}
@end
//Class1.m
@implementation Class1
-(void)loadDict {
NSDictionary * dict = [[NSDictionary alloc] init];
// Now load couple of (NSString *, NSString *) pairs into the dictionary
...
}
-(void)releaseAllMemoryUsedByDict {
//TODO
}
@end
How do I release all the memory occupied by dict, on demand? I guess if I had an NSMutableDictionary, I could call its removeAllObjects method. How would I do it for NSDictionary? Would setting dict = NULL work?