我的应用程序提供了在设备上,而不是在simulator.I仪器采用低内存崩溃,我认为,问题出在下面的部分内存泄漏导致应用程序崩溃
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage imageNamed:@"gembtnblu.png"] forState:UIControlStateNormal];<br>
button.frame = CGRectMake(0, 0, TOOLBAR_BUTTON_WIDTH , TOOLBAR_BUTTON_HEIGHT);<br>
[button setTitle:[NSString stringWithFormat:@"%c",choice] forState:UIControlStateNormal];<br>
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button addTarget:self action:@selector(ChoiceButtonTouched:) forControlEvents:UIControlEventTouchUpInside];
[button setTag:choice];
UIBarButtonItem *customBarItem = [[UIBarButtonItem alloc] initWithCustomView:button];
//Add button to the array
[tempItems addObject:customBarItem];
if (isReviewing == TRUE) {
customBarItem.customView.userInteractionEnabled=FALSE;
}
//release buttons
[customBarItem release];
numberOfChoices++;
,但林不能当场problem.Please帮助guuys,我已经beeen停留在此,现在天
继承人一些代码
NSArray *items=[[NSArray alloc] initWithArray:(NSArray *)tempItems];
[tempItems release];
//add array of buttons to toolbar
[toolbar setItems:items animated:YES];
[self.view addSubview:toolbar];
静态分析器说,这是一个潜在的'items'数组泄漏。但是如果我放入一个发布声明,应用程序崩溃
是的,我的ID释放工具栏 – humblePilgrim 2011-03-09 14:11:35