Create a for loop to add 39 buttons to an array

前端 未结 5 748
情书的邮戳
情书的邮戳 2021-01-02 11:07

I have 39 different UIButton variables in my .h file, but I would like to add each of them to an array without having to type out the same thing 39 times.

Is there a

5条回答
  •  轮回少年
    2021-01-02 11:25

    You could create a getter method named after each button and than call [self valueForKey:]; for each but something here just screams "terrible design" :)

提交回复
热议问题