Debugging can be extremely tedious, and chasing down some bad code that you may have written weeks or months earlier just makes things that much worse. This is where unit testing can be great as you can take care of those bugs in an isolated section of code before they affect the entire program and need to be chased down.
There are quite a few frameworks out there for unit testing with Objective-C including Xcode’s own OCunit which is terrific and easy to use in most cases. I have found an excellent guide from Doug Sjoquist covering the benefits and differences of using OCUnit in Xcode 4 along with the OCmock and GHUnit testing frameworks along with tutorials on the basic usage of each.
You can find the tutorial here:
Unit Testing Quick Start Guide
The official documentation for unit testing with Xcode is here.
The github for GHUnit is here.
The official page for Ockmock is here.
A great intro for anyone looking to understand the basics of unit testing with Objective-C especially if you have trouble following the official documentation.
Submit A Resource
Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?
You can submit the url here.
The resources we feel will appeal to our readers the most will be posted on the front page.