Re: Strings in CCL

"R. Matthew Emerson" <[email protected]> Mon, 5 Oct 2009 13:43:06 -0400
Newsgroups gmane.lisp.mcl.general
Message-ID <[email protected]>
On Oct 5, 2009, at 8:29 AM, Keith L. Downing wrote:

>  Whereas the old version seemed ok with strings being passed to cocoa
> methods (or at least it did display them), I'm now getting error
> messages to the effect that
> a MACPTR is expected instead of a string.
>
>   Does anyone have a simple piece of code that I can wrap around all
> strings to create MACPTRs?  I had trouble finding a good example in
> the CCL documentation.  Should
> I be using make-cstring (which my Listener doesn't seem to
> recognize :) ).

Try:

(ccl::with-autoreleased-nsstrings ((s1 "foo") (s2 "bar"))
   ;; your code here...
   (#/arrayWithObjects: ns:ns-array s1 s2 +null-ptr+))

(not sure if that's in 1.3, but it's in the trunk and will be in 1.4)


_______________________________________________
info-mcl mailing list
[email protected]
http://clozure.com/mailman/listinfo/info-mcl