adding a UITextfield from inside an IBAction

Discussion in 'iOS Programming' started by tazboy, Apr 9, 2010.

  1. tazboy macrumors newbie

    Joined:
    Apr 6, 2010
    #1
    I'm able to add a textfield inside of an IBAction method via

    Code:
    [self makeScoreField:10:120];
    but I get a warning stating:

    Code:
    'GameScorerViewController' may not respond to '-makeScoreField::'
    I'm not sure what the warning means. Any help would be greatly appreciated.
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    It means GameScorerViewController is not aware of any makeScoreField instance method at the point that you make that call. That could be because you haven't defined it at all or not just yet in the implementation file. Either move it up in the implementation file so that it's defined before it's called or declare it in your interface file as public or, better yet, as a so-called private method.

    Also, looks like you are trying to pass two parameters to makeScoreField (10 and 120) but have only named one of them (makeScoreField). I think it's been suggested to you before to step away from the real coding and go (re)learn the basics of Objective-C.
     

Share This Page