我有一個NSMutableArray
,我已經在其中保存了一些字符串值。 NSMutableArray
的大小可能在2-5之間變化(意思是它可能有2 -5個字符串值存儲在其中)。動態創建UIButton - 邏輯錯誤
取決於NSMutableArray
的數量,我需要初始化UIBUttons,然後將String存儲的init的值設置爲按鈕標題。
int numberOfButtonsToBeInitialize= [mutableArr count];// we are finding the number of buttons to be initialize and we assign it to a variable.
現在我需要創建按鈕(什麼都數由numberOfButtonsToBeInitialize
返回)
我怎樣才能做到這一點?