get button object from title

Discussion in 'iOS Programming' started by becu, May 28, 2009.

  1. becu macrumors newbie

    Joined:
    Apr 21, 2009
    #1
    Hi,
    I need to get the receiver (UIButton in this case), but all I have is the button's title. Do we have a method for this? Thanks.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    It's not generically possible: there is nothing preventing two or more buttons on screen having the same title. You can easily get the top-level view on the screen and iterate through all sub-view (and their sub-views) checking the type and titles. I have to say though that if you need to do this you are almost certainly doing something the wrong way.
     

Share This Page