title: Call SEL(selector) of a class in iPhone?
body: <p>I have a class in which i am calling a method(with a SEL parameter) of another class like as follows</p>
  
  <pre><code>// class 1
  
  +(CCScene *) scene
  {
  // 'scene' is an autorelease object.
  CCScene *scene = [CCScene node];
  
  // 'layer' is an autorelease object.
  HelloWorldLayer *layer = [HelloWorldLayer node];
  
  // add layer as a child to scene 
  [scene addChild: layer];
  
  // returns a CClayer Object
  id myClassLayer = [myClass objWithBackgroundSprite:objBackground withRect:CGRectMake(160,100, 300,120) atPoistion:pos_Top];
  
  SEL callOnClick;
  [myClassLayer AddButtonWithImage:ButtonBackground selector:callOnClick withDisabledImage:disabledBackground];
  
  [scene addChild: myClassLayer];
  
  // return the scene
  return scene;
  }
  
  // class 2
  
  -(void)AddButtonToHUDWithImage:(NSString *)imageName selector:(SEL)selector withDisabledImage:(NSString *)disbdImageName
  
  {
  
  CCMenuItem *menuItem1 = [CCMenuItemImage itemFromNormalImage:imageName selectedImage:imageName disabledImage:disbdImageName target:self selector:@selector(selector)];
  
  CCMenu *menu = [CCMenu menuWithItems:menuItem1,nil];  
  [menu setPosition:ccp(160,100)];
  [self addChild:menu];
  }
  
  -(void)selector
  {
      // not creating any object .. some other way if possible
  }
  </code></pre>
  
  <p>but i would like to declare the selector method(callOnClick) in HelloWorld only(myClass being a Generic Class).</p>
  
  <p>How can i call the selector in HelloWorld only??</p>