How to determine if code is running in Foundation or GUI?
- by Mitch Cohen
I'm writing a Mac app with two targets - a regular Cocoa GUI and a Foundation command-line tool. They do very similar things other than the GUI, so I'm sharing most of the code between the two.
I'd like to do a few things slightly differently depending on which target is running. I can think of many ways to do this (#define something in the pch, check for existence of GUI definitions...). I'm curious if there's a standard or recommended way to do this. Thanks!