好吧,所以我知道我可以忽略NSLog,但爲什麼它會給我一個「EXC_BAD_ACCESS」錯誤?NSLog給出運行時錯誤
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex2
{
if(buttonIndex2 == 0 && waitForAction == NO)
{
waitForAction = YES;
[self showAbortAlert];
NSLog(@"%@",buttonIndex2); //This one does not crash the app
} else if (buttonIndex2 == 1 && waitForAction == NO)
{
waitForAction = YES;
[self addObject];
NSLog(@"%@",buttonIndex2); //This one crashes the app
} //else if
}
謝謝!我誤解了這一點。 – 2012-01-27 11:32:17
或'%i'(我個人喜好導致我認爲int不是十進制)。 – vakio 2012-01-27 11:33:50