Control Arrays...

Discussion in 'iOS Programming' started by dgdosen, Aug 2, 2008.

  1. dgdosen macrumors 65816


    Dec 13, 2003
    Here's a an issue I'm having:

    I'm trying to create control array of buttons on a controller, and have a subview place to them on the screen. A scenario like the Stocks App.

    I can get the buttons to layout and look exactly how I want, but when I implement the buttons as an array of buttons (NSMutableArray), I can't get the action to fire in the controller.

    If I remove the array and just create a bunch of buttons - it works (just longer-winded code).

    Should I be able to do this? I'm wondering if when I pass the controls as views to the subview if I'm losing something or not retaining something I should...

    Any ideas? any examples of button control arrays? All the samples are individual buttons
  2. dgdosen thread starter macrumors 65816


    Dec 13, 2003
    Well, this thread had a lot of activity!

    I found out my issue.

    First off, Objective C can handle exactly what I wanted to do with Control Arrays.

    My issue? I was creating multiple UIViews with one that I thought was in the background, but was over the top of my control array. The action never hit my controls.

    If I change the order of how I lay things out in my view - they work. Therefore, there's an idea of a Z Order to controls in a View.
  3. voinguyen macrumors newbie

    Jan 3, 2009

    Hi louden,

    Can you show me how to create an array of controls?
    I am stuck with this problem myself and I noticed you solved your problem.

    Also, how do you change the z-order for multiple controls?

Share This Page