-5

当我计数 1 +1 时,我得到 5 的回报……谁能帮助我?以前一直在做这样的 couters,但这一个返回奇怪的结果....

load_count = (load_count +1);
NSLog(@"loadcount %d",load_count);
if (load_count == 0){
    load_count = 1;
}
if (load_count = (picture_count +1)) {
    load_count = 1;
}

load_count = int

picture_count = 从数组中提取的 int(返回图片的数量 a 数组)

日志结果:

2013-03-14 12:04:44.325  loadcount 5
2013-03-14 12:04:47.977  loadcount 5
2013-03-14 12:04:50.800  loadcount 5
4

1 回答 1

0

目前尚不清楚,但我认为您正试图load_count0to增加picture_count并再次环绕 to 0

如果是这样,这一切:

load_count = (load_count + 1) % picture_count;
于 2013-03-14T11:33:57.253 回答