This is odd. Perhaps I need coffee. I have an app where I hide something by
default (UIView). touchesBegan will make it visible. touchesMoved keeps
visible. touchesEnded after 2 seconds. My method is never getting called.

In my .h

NSTimer *screenTimer;
...
@property(nonatomic,retain) NSTimer *screenTimer;

My .h
----------------------------------------------------------------------
@synthesize screenTimer;
...

//Never called...
- (void)turnOffScreen:(NSTimer *)theTimer {
    NSLog(@"TURN OFF SCREEN");
    myView.hidden = YES;
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    myUIView.hidden = NO;

    if(screenTimer.isValid){

        [screenTimer invalidate];

    }
}

//After 2 seconds hide the view
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {

    screenTimer = [NSTimer timerWithTimeInterval:2 target:self selector:
@selector(turnOffScreen:) userInfo:nil repeats:NO];
}
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to