【发布时间】:2014-04-22 21:10:16
【问题描述】:
我希望 TempScore 在保存并与旧值一起添加到 Score 变量后立即返回 0
if (self.currentQuestion < [self.questions count]) {
_TempScore = x;
_Score = y;
_Score = x + y;
x = 0;
}
为什么这不起作用?
编辑:让它工作
self.x = self.TempScore;
self.y = self.Score;
self.Score = self.x + self.y ;
self.TempScore = 0;
【问题讨论】:
-
self.Score 与 _Score 相同,但不调用 setter。 self.TempScore 和 _TempScore 具有类似的相关性。不确定您到底要做什么,但请记住这一点。
-
谢谢我粘贴了一些我忘记剪掉的旧行
-
@lea51294 你想做什么?您只是将
_TempScore和_Score设置为0? -
我希望 tempscore 在保存并将旧值添加到 score 变量中后立即返回 0
-
你明白我想做什么了吗?
标签: xcode variables sum temporary