Quick iOS code testing and objective-c

I was wondering if there is a way to quickly check iOS / objective-c snippets or new code inside my xcode project without having to compile the whole application for it, open the simulator to get the NSLog message on the console.

I remember when life was easier with the ruby ​​irb or node command for node.js :)

It just seems that when developing iOS, you need to constantly learn to cope with this high complexity and dependencies, but I'm just starting in this new world. therefore any help would be appreciated.

Many thanks

+7
source share
4 answers

This timely post blog should help; I often use it already.

Update : There is also Code Runner available in the Mac App Store - it supports many languages, including Objective-C.

+5
source

An Xcode project can contain several goals. One of the goals may be a test driver in which you can put some class / object / fragment exercise code and output it from the command line, the results on the debugging console. Another option is to create unit test goals.

+1
source

If the code you write knows the expected I / O pairs, and you just write the code to make them work, you may need to explore the possibilities of testing Xcode modules. A link to the unit test tutorial is at http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/UnitTesting/0-Introduction/introduction.html . If you want to test more interactive things, you can use the Tools (program in Xcode) to automate these tests using the Automation tool. A guide to using the tools is available at http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/AboutTracing/AboutTracing.html .

+1
source

Not really - Objective-C is a compiled language, while I believe that Ruby is interpreted (which allows for interactive testing, like what you describe). You can reduce part of the overhead for the construction and launch of your project by simply leaving the simulator open; stopping the application from Xcode will close the application, but leave the simulator running, which means that the restored version of the application will start faster at startup.

0
source

All Articles