1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

NSEventTrackingRunLoopMode not found error

Discussion in 'iPhone/iPad Programming' started by mikezang, Jan 22, 2011.

  1. macrumors 6502a

    #1
    I use code as below, but got error when compile ViewController.m:316:0 'NSEventTrackingRunLoopMode' undeclared (first use in this function)
    What can I do?

    Code:
    -(void) StartTimer {
    	timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerTick:) userInfo:nil repeats:YES];
    	[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode];
    }
     
  2. Moderator

    robbieduncan

    Staff Member

    #2
    Uh hu. So if you look up NSRunLoop in the iOS documentation you see that constant is not defined in NSRunLoop. It may be defined in one of NSConnection or NSApplication. Given the name we will assume it's not NSConnection (as it's modes start with NSConnection). NSApplication does not exist on iOS.

    This can be confirmed by looking at the NSApplication documentation.

    So in short: that mode does not exist and cannot be used on iOS.

    And please learn to use the documentation. Almost every single question you ask can be answered in a few short moments by reading the documentation for yourself.
     
  3. macrumors 6502a

    #3
    Thanks for your advise, though I also found that document,I couldn't find why I can't use it, so I asked here.
    By the way, back to my question, can you tell me which mode in iOS can be used to do the same thing?
     
  4. Moderator

    robbieduncan

    Staff Member

    #4
    None? There is no such thing as a "a mouse-dragging loop" on iOS.
     
  5. macrumors 6502a

    #5
    Well, I did it, thanks again.
     
  6. Moderator

    dejo

    Staff Member

    #6
    Did what? :confused:
     

Share This Page