4 ms·
Okay this sounds really cool, but I am a little confused as to how to implement it. How do I use the console to interact with my app in the simulator?
by ctruman 14y ago
Okay this sounds really cool, but I am a little confused as to how to implement it. How do I use the console to interact with my app in the simulator?
- 286c8cb04bda 14y ago> How do I use the console to interact with my app in the simulator? Nu builds as a static library. You need to include it in your project and link it into your binary to make it available. Then you'll need to instantiate a NuRemoteHost object after your application has launched. Once it's running you can launch a Nu interpreter and execute NuRemoteClient to connect to the host you created earlier.
- funkyboy 14y agobut then you type nu code in the prompt, not obj-c, right?
- 286c8cb04bda 14y agoYes, you'll be typing Nu code in a Nu interpreter. Even though it's a Lisp dialect, Nu was designed from the beginning to be interoperable with Objective-C, so translating between them is easy. (Convert brackets to parentheses and you're 80% of the way there.) As a contrived example, this: if(![self.address startsWith:@"https://"]) self.address = [@"https://" stringByAppendingString:self.address] Becomes this: (if (not (@address startsWith:"https://")) (set @address ("https://" stringByAppendingString:@address)))
- funkyboy 14y agothanks for the link. I'll try it out.