的錯誤是: 「爲UIAlertView中無可見@interface聲明選擇 'initWithTitle:消息:委託:cancelButtonTitle:otherButtonTitle:'」爲 'UIAlertView中' 不可見@interface聲明選擇
- (void) subtractTime;
{
seconds --;
timerLabel.text = [NSString stringWithFormat:@"Time: %i", seconds];
if(seconds == 0)
{
[timer invalidate];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Time is up !"
message: [NSString stringWithFormat: @"You Scored %i points", count]
delegate:self
cancelButtonTitle: @"Play Again?"
otherButtonTitle:nil];
}
}
@end
當您看到該消息並且您知道該方法應該存在時,您應該始終仔細查看代碼:您拼寫的方法名稱錯誤。 – Caleb