Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (id)retrieveObjectForClass:(Class)cls withSignature:(NSMethodSignature *)sig withKey:(id)key {
- if (_store == nil) {
- _store = [NSMutableDictionary dictionary];
- }
- id cached_copy = [_store objectForKey:key];
- if (cached_copy != nil)
- return cached_copy;
- NSInvocation *inv = [NSInvocation invocationWithMethodSignature:sig];
- [inv invoke];
- id new_copy;
- [inv getReturnValue:&new_copy];
- return new_copy;
- }
Add Comment
Please, Sign In to add comment