0

After building a UI with a fair amount of buttons (with tags) that are created in a for loop, I can load specific data into a UIWebView depending on the button touched.

but the only "argument" i can get is the senders tag, my question is what is the best way to pass more parameters if needed. I thought of:

  1. Creating a subclass for those buttons with parameters I need.
  2. having an array of objects, and addressing it by those tags.

or maybe there are some more elegant, sophisticated ways?

I hope I made myself clear. Thanks in advance

Alexidze
  • 183
  • 3
  • 14
  • You can get a lot of things from sender though. Sender has a tag property, sender has a state property. Sender has a frame property. – CodaFi Mar 27 '12 at 20:57
  • See accepted (and other) answers to [this question](http://stackoverflow.com/questions/5500327/subclass-uibutton-to-add-a-property) – FluffulousChimp Mar 27 '12 at 20:59
  • and if i want to pass a string for example? – Alexidze Mar 27 '12 at 20:59
  • Great! thanks a lot, strange how didn't i find that – Alexidze Mar 27 '12 at 21:01
  • If you would have tried to find out in stackoverflow it self then you might have got the answer. http://stackoverflow.com/questions/450222/how-can-i-pass-a-parameter-to-this-function http://stackoverflow.com/questions/2117126/how-to-pass-parameters-through-ibaction-in-iphone-sdk – Praveen-K Mar 27 '12 at 21:09

0 Answers0