Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

techwoman

macrumors newbie
Original poster
Nov 22, 2014
29
0
USA
I am preparing for iOS interviews and since most of companies concentrate on data structures and algorithms, I thought of working on creating basic data structure and algorithms (DSA). I have always worked on adding/amending code in the existing app at work, but this is the first time I am creating something of my own from scratch.

So I created a cocoa touch static library for my DSA project and I added linked list code to insert/delete nodes. I wish to test these methods, so I added another class with main() in it. The project builds fine, but when I run it nothing happens. It doesn't execute main method at all.

Is adding the library to an app or testing the code through unit test are only methods to test it? What would be the best way to test my DSA code?
 
Class with main in it? This is not Java.

A static library doesn't do anything by itself. It has to be part of an app to be executed. I think you should be able to test it using unit tests.
 
Class with main in it? This is not Java.

A static library doesn't do anything by itself. It has to be part of an app to be executed. I think you should be able to test it using unit tests.

Thanks PhoneyDeveloper!

I changed the project type to be command line tool so I can execute the code through main() in command line.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.