4
這是我使用的代碼:爲什麼我的UIButton不顯示?
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 50, 70)];
[self.view addSubview:button];
if (buttonArray == nil) {
buttonArray = [[NSMutableArray alloc] init];
}
[buttonArray addObject:button];
[button release];
的對接不顯示,但是。任何想法爲什麼?
我不認爲你應該釋放'按鈕',如果你這樣初始化它。 – TPoschel 2011-11-21 18:40:49
@TPoschel你說得很對。更新了答案。 – 2011-11-23 13:41:21