我正在创建一个有 4 个答案的问答游戏,我想添加分数。每个正确答案都值 50 分,错误答案是 -50 分。我怎么做?
- (IBAction)bpressed1:(id)sender {
if ([self.answer isEqualToString:@"a"]) {
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"yes!"
message:@"+50."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[message show];
[message release];
[self nextq];
}else{
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"no!"
message:@"-50."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil]
[message show];
[message release];
[self nextq];
}
}