I'm sorry, but I have to return to my earlier question about NSTimer. I've
received some suggestions and they helped me to move forward. But what I've
done so far doesn't work. Here's what I have:
public MyClass() {
super();
...
NSRunLoop theLoop = NSRunLoop.currentRunLoop();
NSSelector
aSel = new NSSelector("secondElapsed", new Class[] {Object.class});
NSTimer theTimer = new NSTimer(1.0, this, aSel, null, true);
theLoop.addTimerForMode(theTimer, theLoop.DefaultRunLoopMode);
}
public void secondElapsed(NSTimer theTimer) {
...
}
(I also tried 'new NSSelector("secondElapsed", null)').
It, sure, passes compilation, but secondElapsed doesn't seem to get called.
Am I missing something? I assume, addTimerForMode is necessary... or should
I do something else or differently?
And while I'm at it, I have another, general question. I cannot check
variables in the debugger. Even though I build "debug" target and run it in
debugger mode, every time I stop, select a variable and click any of the
Print Value buttons in the Launch window I get things like:
JavaDebug>> print theTimer
"theTimer" is not a valid local or class name.
JavaDebug>> print * theTimer
"*" is not a valid local or class name.
"theTimer" is not a valid local or class name.
JavaDebug>> po theTimer
"theTimer" is not a valid local or class name.
(As you understand I'm using Java).
Any ideas? Help would be greatly appreciated. Thanks a lot.
Leon