[Openmcl-devel] Bridge and NSTimer

Gary Byers gb at clozure.com
Tue May 1 14:37:54 PDT 2007


What thread does that code run in ?  (I guess that the more relevant
question is "what NSRunloop is the NSTimer associated with ?")



On Tue, 1 May 2007, Phil wrote:

> Is there anything special to getting NSTimer to work via the bridge?  I don't 
> see anything wrong with this code but the timer doesn't seem to be firing.
>
> (defclass timer-test (ns:ns-object)
> ()
> (:metaclass ns:+ns-object))
>
> (ccl::define-objc-method ((:void :timer-fired the-timer) timer-test)
> (#_NSLog #@"timer fired"))
>
> (setf mytimer-objc (objc:make-objc-instance "TimerTest"))
> (objc:send (objc:@class "NSTimer")
> 	   "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"
> 	   1.0d0
> 	   mytimer-objc
> 	   (objc:@selector "timerFired:")
> 	   nil
> 	   nil)
>
> Thanks,
> Phil
>
>



More information about the Openmcl-devel mailing list