Passing a selector into an NSDictionary

Discussion in 'iOS Programming' started by ZaBlanc, Jun 10, 2009.

  1. ZaBlanc macrumors newbie

    Joined:
    Apr 28, 2009
    #1
    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.

    :-(
     
  2. ZaBlanc thread starter macrumors newbie

    Joined:
    Apr 28, 2009
    #2
    Sometimes I feel like posting to the forum means I'll figure it out myself. :)

    Found NSSelectorFromString and NSStringFromSelector!
     

Share This Page