开发者

How can I make it so the user taps a segmented tab button and changes the mainInt time to an amount of seconds?

code:

-(void)countUp {

    mainInt += 1;
    seconds.text = [NSString stringWithFormat:@"%i", mainInt];

    if (difficulties.selectedSegmentIndex == 0) {
        (mainInt == 30);
        [timer invalidate];
    }
}

i would need 3 of these. for 3 segme开发者_如何转开发nted tabs, so the user taps Easy and it makes the time 30 seconds, when they tap medium, it makes it 20 seconds, and when they tap hard, it makes it 10 seconds.


with alegbrizzle assuming the index of easy is 0, medium is 1, hard is 2;

mainInt = 10 + (difficulties.selectedSegmentIndex * 10);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜