I’m not sure how to put this best into a title, but this is what i want. Say i’m creating a number of UIlabels programmatically, and i want them to have the names label1, label2, label3 ect.
How do i name a new label the next one. And say i know i want to refer to label3 at this point, but i might want to refer to another number at another point, how would i write that in the code?
so instead of label5.text = ..., what could i put? Because it won’t always be label5.
Don’t confuse yourself! It’s tempting to think:
Or something like that would work. The names we use are for our convenience, the compiler uses the pointer to the object instead of the label.
What could work is an array or set of the pointers: