Do Method

Discussion in 'iOS Programming' started by lynkynpark86, May 7, 2010.

  1. lynkynpark86 macrumors 6502

    #1
    I am new to iPhone developing, so I apologize if I am using incorrect terminology here, but here goes: I need one method (IBAction) to trigger another. I want to make an action sheet, and show an alert when a button on the sheet is pressed. I have already done it, but for the sake of learning, I want to make another action to show the alert, and the first action trigger that action. something like this:
    Code:
    - (IBAction)trigger{
        doMethod @"showAlert"
    }
    
    So I want it to do something like that. If anyone knows how to do this, please respond. Thanks
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    The same was as you would call any other method: specify the target object, method name and arguments.

    This is well covered in the Introduction to Objective-C. Given your clear issues with the basics I suggest you take your time and read the entire thing, ensuring you don't move on if there is something you don't understand.
     

Share This Page