Jul 05

Amazingly, Xcode comes built with a Unit Test suite and an Application Test suite. However, it took a bit of trying to fully understand how to set it up. The key element is adding a new Build Target.

XcodeScreenSnapz001

Set the new target as “Unit Test Bundle” and you’re done. Now, you can add new class files using the “Objective-C test case class” as the template and write Unit Tests. Now, make sure you set the only build target of this new class as the Unit Test target you created previously (that’s very important).

Now, when you want to run your unit tests, simple switch your build target and hit the build button.

XcodeScreenSnapz002

Comments are closed.

preload preload preload