Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikezang

macrumors 6502a
Original poster
May 22, 2010
861
9
Tokyo, Japan
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];
}
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 

mikezang

macrumors 6502a
Original poster
May 22, 2010
861
9
Tokyo, Japan
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.
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?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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?

None? There is no such thing as a "a mouse-dragging loop" on iOS.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.