How to call a class method from different class through selector

Discussion in 'iOS Programming' started by bluehill, Mar 28, 2011.

  1. bluehill macrumors newbie

    Joined:
    Feb 5, 2011
    #1
    I am trying to call a class method of ClassA
    Code:
    +(void)functionName:(Nsstring*)str
    with help of
    Code:
    NSInvocationOperation *operation1 = [[NSInvocationOperation alloc] 
    initWithTarget:instanceOfClass																			 selector:@selector(functionName:)																   object:str];
    in ClassB

    but it is asking me to create an instance of ClassA.
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
  3. bluehill thread starter macrumors newbie

    Joined:
    Feb 5, 2011
    #3
    Hey was so simple thanks...:)
     
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    The class object is a topic that isn't really understood by everyone but does come up sometimes.
     
  5. bluehill thread starter macrumors newbie

    Joined:
    Feb 5, 2011
    #5
    Their are lot of things to be learnt by you guys...u are simply great..:)
     

Share This Page