How to determine if code is running in Foundation or GUI?

Posted by Mitch Cohen on Stack Overflow See other posts from Stack Overflow or by Mitch Cohen
Published on 2012-09-29T19:03:46Z Indexed on 2012/11/01 17:01 UTC
Read the original article Hit count: 260

Filed under:
|

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!

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about foundation