Control Sets Corollary

Is there anything like the Control Set available for iOS? If not, what do you use to address a group of same controls so as not to have to code each one separately?

For iOS you can actually create the controls on the fly and add them to your view in code so you could create an actual array to store the objects then proceed from there. If you connect the events with AddHandler to the same method (for example “HandleAction(sender as iOSButton)”) then you can look up the control index using array.indexOf(sender) and proceed as you would normally with a control array on desktop.

I have found another approach that does not require an array or dynamic creation.

I create a BtnAction method that will be for all “members”, and for instance for buttons add sender as iOSButton as parameter.

In the Open event, I place the addhandler :

Sub Open() addhandler me.Action, AddressOf btnAction End Sub

In the close event, I place the removehandler :

Sub Close() removehandler me.Action, AddressOf btnAction End Sub

I simply then duplicate the control like I would do for members : Button1, button2, etc.

In the btnAction method, I get the name of the calling button through sender.Name, and just by looking at Integer.FromText(sender.name.Replace("Button","")).

Thanks Jason and Michel. I’ll give these techniques a try. Apparently, Xojo for iOS is like learning a new language.