XCode: Won't let me add more than 1 button

Discussion in 'iOS Programming' started by stephanie4992, Sep 5, 2013.

  1. stephanie4992 macrumors newbie

    Joined:
    Sep 5, 2013
    #1
    Hi Everyone,
    I'm really new to this and I'm following a tutuorial on Udemy, but I can't get past one section.

    I am trying to add a button to Table View Controller and I can add only 1. I drag it over, it loads. I try to drag another like the tutorial shows and it snaps back and doesn't load. So:
    - I can't add more than one
    - I can't resize or format the one I put in.

    I tried to go to the edit menu and duplicate, but that won't work.

    What am I missing? Is there a setting that isn't allowing me to add in more than one or format the one I can add?
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    A screenshot including your view hierarchy would be helpful here, I think.
     
  3. Sonnestah macrumors regular

    Joined:
    Mar 2, 2013
    #3
    You are probably trying to drag a UIBarButtonItem to the bar on top of the table, right? Using interface builder, you will only be able to drag one for each side of the bar.

    If you need more, you will have to programmatically add them:

    1 - Search how to create a UIBarButtonItem programmatically
    2 - Create as many as you need
    3 - Add them to an array
    4 - Add array to rightBarButtonItems, titleView or leftBarButtonItems properties of your navigationBar
     

Share This Page