cancelPreviousPerformRequestsWithTarget

时间:2012-05-17 09:57:17

标签: iphone performselector

cancelPreviousPerformRequestsWithTarget对我不起作用,我检查过每个人说它工作正常但对我来说不是

我在performselector中调用以下内容

[self performSelector:@selector(Opacity:) withObject:self.objopcarray afterDelay:reversedelay];

现在我想在按钮点击之前将其取消,然后点击它,所以我做了以下

- (void) pressNextButton:(id)sender
{
    [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(Opacity:) object:self.objopcarray];

    if (self.animationON == YES)
    {
        if (self.panel < 16) 
        {
            [self DisplayImages];
            [timer invalidate];
            timer = [NSTimer scheduledTimerWithTimeInterval:sketchanimduration target:self selector:@selector(DisplayImages) userInfo:nil repeats:YES];

            if(self.panel > 16)
            {
                self.panel = 0;
            }
        }
    }

}

但结果仍然相同

任何帮助都将受到高度赞赏

0 个答案:

没有答案