Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Relying on dictionaries to retain their objects
Foo *foo = [_cache objectForKey:key];
if (!foo)
{
foo = [[Foo alloc] init...
[_cache setObject:foo forKey:key];
[foo release]; // expect the cache dictionary to retain it
}
return foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment