PDA

View Full Version : Passing a selector into an NSDictionary




ZaBlanc
Jun 10, 2009, 03:33 PM
The following won't work:

NSDictionary *callObject = [[NSDictionary alloc] initWithObjectsAndKeys:target, @"target", selector, @"selector", nil];

Any workarounds for passing a selector through to a thread? I'm trying to encapsulate a network process so that a performSelectorInBackground: can be used, but since I can only pass one (or maybe two) objects into it (using withObject:), I am wrapping my args in an NSDictionary.

:-(



ZaBlanc
Jun 10, 2009, 03:37 PM
Found NSSelectorFromString and NSStringFromSelector!