<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm trying to get the right Cocoa bridge syntax for calling:<span class="Apple-style-span" style="font-family: 'lucida grande'; font-size: 19px; font-weight: bold; "></span><div><font class="Apple-style-span" face="'lucida grande'" size="6"><span class="Apple-style-span" style="font-size: 19px;"><b><br class="webkit-block-placeholder"></b></span></font></div><div><span class="Apple-style-span" style="font-family: 'lucida grande'; font-size: 19px; font-weight: bold; ">scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:</span><div><span class="Apple-style-span" style="font-family: 'lucida grande'; "><p class="spaceabove" style="margin-top: 13px; margin-bottom: 10px; font: normal normal normal 12px/normal lucida grande, geneva, helvetica, arial, sans-serif; ">Returns a new <code style="font-size: 11px; font-family: monaco, courier, monospace; font: normal normal normal 11px/normal Monaco, Courier, monospace; ">NSTimer</code> object and adds it to the current <code style="font-size: 11px; font-family: monaco, courier, monospace; font: normal normal normal 11px/normal Monaco, Courier, monospace; ">NSRunLoop</code> object in the default mode.</p><p class="spaceabovemethod" style="font: normal normal normal 11px/normal monaco, courier, monospace; margin-top: 13px; margin-bottom: 10px; ">+ (NSTimer *)scheduledTimerWithTimeInterval:(<a href="file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html#//apple_ref/doc/c_ref/NSTimeInterval" target="_top" style="color: rgb(0, 0, 255); text-decoration: none; ">NSTimeInterval</a>)<i style="font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-style: italic; ">seconds</i> target:(id)<i style="font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-style: italic; ">target</i> selector:(SEL)<i style="font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-style: italic; ">aSelector</i>userInfo:(id)<i style="font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-style: italic; ">userInfo</i> repeats:(BOOL)<i style="font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-style: italic; ">repeats</i></p></span></div><div>NSTimeInterval is just a typedef to double, so I thought that I could just pass the double value to the function, since this is how many of the example Objective C programs are written, but this does not work for a variety of reasons:</div><div><br class="webkit-block-placeholder"></div><div><div><div>1. If I attempt to simply use a bare double, it's not happy:</div><div><br class="webkit-block-placeholder"></div><div></div><div> (let* ((TimerInterval (ccl::%double-float 0.01)))</div><div> (Timer (#/scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: TimeInterval (cocoa-view self) (objc:@selector #/animate) (ccl::%null-ptr) #$YES)))</div><br class="webkit-block-placeholder"></div><div>> Error: value 0.009999999776482582D0 is not of the expected type MACPTR.</div><div>> While executing: CCL::SEND-UNAMBIGUOUS-MESSAGE, in process listener(1).</div></div><div><br class="webkit-block-placeholder"></div><div>2. If I attempt to use an RLET to allocate the C Type, it's still not happy:</div><div><br class="webkit-block-placeholder"></div><div><div> (rlet ((TimeInterval :<NST>ime<I>nterval (ccl::%double-float 0.01)))</div><div> (let* (</div><div> (Timer (#/scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: TimeInterval (cocoa-view self) (objc:@selector #/animate) (ccl::%null-ptr) #$YES))))</div><div> ;; add myself to list</div><div> (pushnew Self (animated-views Self))))</div><br class="webkit-block-placeholder"></div><div><div>> Error: value #<A Foreign Pointer [stack-allocated] (:* DOUBLE-FLOAT) #xB029BE70> is not of the expected type OBJC:OBJC-OBJECT.</div></div><div><div>> While executing: CCL::SEND-UNAMBIGUOUS-MESSAGE, in process listener(1).</div><div><br></div><div>I vaguely remember a mechanism to convert native C types to Cocoa analogs, but I cannot find documentation of this, and may be mixing Objective C up with something up.</div><div><br class="webkit-block-placeholder"></div><div>What's the correct way to deal with this particular API call?</div><div><br class="webkit-block-placeholder"></div><div>Thanks,</div><div><br class="webkit-block-placeholder"></div><div>-Brent</div></div></div></body></html>