开发者

Removing a subview my timer keeps running - iPhone SDK

I have a NSTimer running in a subview of a view. I want to remove the view and of course stop the timer. I seem to be able to remove开发者_运维百科 the view (it physically disappears) but the timer keeps running, I can see the trace statements still.

This is the code to remove the view...

for (UIView *subview in [self.myViews subviews]) {
    NSLog(@"*****REMOVE current views!!!!!!!!!!!!");
       // Only remove the subviews with tag not equal to 1
    if (subview.tag != 1) {
     NSLog(@"*****!!!");
     [subview removeFromSuperview];
    }


Did you try [timer invalidate] right after [subview removeFromSuperview]?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜