Ok, let's simply say I have a simple e-mail list flick Panel.
I create a button "Read Message" and one UILabel.
I get from the server a number, it says for example 4, I have 4 e-mails. So I clone the collecting of one button and one uilabel 4 times.
Now I have cloned the objects 4 times, they are repositioned in the panel and scrolling works. Ok so far?
All the "Read Message" buttons are the same and point to the same function.
Let's say
"void GetEMailMessage()"
Unfortunately my function to get that e-mail message requires a pointer and my function is.
"void GetEMailMessage(int pointer)"
But none of the buttons are able to pass a parameter to this function, just call it.
To get around this I renamed each of the cloned objects to a number. It looks something like this.
0 - MyUILabel
|
--MyUIButton
1 - MyUILabel
|
--MyUIButton
2 - MyUILabel
|
--MyUIButton
3 - MyUILabel
|
--MyUIButton
All my buttons point to "void GetEMailMessage()"
So I grab the name of the object and int.TryParse it and then pass that into a different function.
My question is, is there a better way of doing this?
I hope this explanation makes sense