Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dgdosen

macrumors 68030
Original poster
Dec 13, 2003
2,817
1,463
Seattle
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
 

dgdosen

macrumors 68030
Original poster
Dec 13, 2003
2,817
1,463
Seattle
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.
 

voinguyen

macrumors newbie
Jan 3, 2009
1
0
Help

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?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.