<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I am curious if there is a way to define a new objc type that will be recognized by objc methods as a parameter, I thought I could just find where :<NSI>nteger was defined but I had no luck when I looked for that definition. Most of the time you can just list your parameter without a type but it seems that in the case of an NSTimer you may need to define the type explicitly. Here is my little example that seems to need this explicit type definition for the timer parameter:<div><br></div><div><div>(defclass COCOTRON-VIEW (ns:ns-opengl-view)</div><div> ()</div><div> (:metaclass ns:+ns-object))</div><div><br></div><div>(defun COCOTRON-TEST ()</div><div> (ns:with-ns-rect (frame 0 0 200 200)</div><div> (let* ((window (make-instance ns:ns-window :height 300))</div><div> (opengl-view (#/retain (#/initWithFrame:pixelFormat: (#/alloc cocotron-view) frame (#/defaultPixelFormat ns:ns-opengl-view))))</div><div> (timer (#/retain (#/scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: ns:ns-timer .01d0 opengl-view (objc::@selector #/timer:) nil #$YES)))) ;;***********This is the line of importance***************</div><div> (#/orderFront: window nil))))</div><div> </div><div>(objc:defmethod (#/timer: :void) ((self cocotron-view) timer)</div><div> (print "TIMER"))</div></div><div><br></div><div>It seems to me that this code should work but timer is never printed, I believe the problem is because I am not explicitly defining the type of the parameter. The documentation of the method #/scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: states that the selector must have the following signature:</div><div><br></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; border-collapse: collapse; font-size: 12px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><pre style="margin-top: -0.083em; margin-bottom: 0px; font-size: 12px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); margin-right: 0.333em; margin-left: 0.5em; line-height: 13px; white-space: pre-wrap; ">- (void)timerFireMethod:(NSTimer*)theTimer</pre><pre style="margin-top: -0.083em; margin-bottom: 0px; font-size: 12px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); margin-right: 0.333em; margin-left: 0.5em; line-height: 13px; white-space: pre-wrap; "><br></pre><pre style="margin-top: -0.083em; margin-bottom: 0px; font-size: 12px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); margin-right: 0.333em; margin-left: 0.5em; line-height: 13px; white-space: pre-wrap; "><br></pre></span><div>So I assume my problem is that I am defining the type of the timer loosely. Anyone know how I could explicitly define the parameter in this example? Something like this: </div></div><div><br></div><div><div>(objc:defmethod (#/timer: :void) ((self cocotron-view) (timer ns:ns-timer))</div><div> (print "TIMER"))</div></div><div><br></div><div>gives this error:</div><div><br></div><div><div>> Error: Unknown foreign type: NS:NS-TIMER</div><div>> While executing: CCL::%PARSE-FOREIGN-TYPE, in process Listener(11).</div><div>> Type cmd-. to abort, cmd-\ for a list of available restarts.</div><div>> Type :? for other options.</div><div>6 > </div></div><div><br></div><div>Thanks a lot,</div><div><br></div><div>--Mike</div></body></html>