0
我不想用for循環將標籤(數組中的字符串)添加到按鈕上。用for循環在不同座標中添加標籤
我是新來的objective-c,我不知道如何在每次迭代時將所有更改都放入循環中。 如果有更好的方法來做到這一點,請給我看看。現在我得到了這個,它只在右上角打印數組中的第二個元素。
for (int i=0; i< sizeof(arrayOfLetters); i++) {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(441,11,30,20)];
label.text = [NSString stringWithFormat:@"%@",[arrayOfLetters objectAtIndex:1]];
[self.view addSubview:label];
}
非常感謝!它像一個魅力一樣工作! :) –