Guest User

Untitled

a guest
Aug 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. - (id)retrieveObjectForClass:(Class)cls withSignature:(NSMethodSignature *)sig withKey:(id)key {
  2. if (_store == nil) {
  3. _store = [NSMutableDictionary dictionary];
  4. }
  5.  
  6. id cached_copy = [_store objectForKey:key];
  7. if (cached_copy != nil)
  8. return cached_copy;
  9.  
  10. NSInvocation *inv = [NSInvocation invocationWithMethodSignature:sig];
  11. [inv invoke];
  12. id new_copy;
  13. [inv getReturnValue:&new_copy];
  14. return new_copy;
  15. }
Add Comment
Please, Sign In to add comment