Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > ObjC and CLI applications

ObjC and CLI applications
Thread Tools
Fresh-Faced Recruit
Join Date: Jan 2001
Location: Areas 51 thru 55 :P
Status: Offline
Reply With Quote
Apr 11, 2001, 12:11 PM
 
OK, this probably sounds stupid, but I actually have a *good* reason for asking: how does one write CLI applications with ObjC while still utilizing NSObject as the base class (or, more speficially, using the Foundation and AppKit classes)?

I figure that the C library functions like printf() et all will be there, but is there an easy way to integrate with NSObject et al?

Rationale: For model level objects I like to write indepdent test drivers (ala jUnit framework for Java or similar to what Lakos wrote about in Large Scale C++ Software Design). This means testing object functionality external from the application. This further implies a mechanism that allows you to utilize objects derived from NSObject outside the context of the Cocoa GUI application being developed.

I *suppose* I could write a GUI app stub that did this, but my preference is to run test drivers from the command-line and look at sysout for results since we are only talking about test drivers (i.e. I don't want to spend extra time generating a UI for a test driver, I just want the results of the test).
Well, let's just say, 'if your VCR is still blinking 12:00,you don't want Linux'
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Apr 11, 2001, 12:26 PM
 
New Project>Tools>Foundation Tool (Or something like that).

You can then include whatever frameworks you want. It will be a command-line app.

I figure that the C library functions like printf() et all will be there, but is there an easy way to integrate with NSObject et al?
What do you mean?
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: Areas 51 thru 55 :P
Status: Offline
Reply With Quote
Apr 11, 2001, 04:01 PM
 
Originally posted by parallax:
New Project>Tools>Foundation Tool (Or something like that).

You can then include whatever frameworks you want. It will be a command-line app.

What do you mean?
Thanks, that is exactly what I wanted to know.

What I meant was, how does a Cocoa application that does not use NSApplication interact with the Cocoa system. You answered my question with the Foundation App thing.
Well, let's just say, 'if your VCR is still blinking 12:00,you don't want Linux'
     
ali
Forum Regular
Join Date: Sep 2000
Status: Offline
Reply With Quote
Apr 11, 2001, 05:33 PM
 
In general, if you link with Foundation.framework, you have a command-line app; if you link with AppKit. framework (or Cocoa.framework), you have a UI app. However, even if you link with AppKit or Cocoa but don't instantiate an NSApplication object (or some other objects which require a connection to the graphics subsystem or other UI services, such as the dock), you can still be a "command-line" app. This might be handy if you want to be a server or background tool which uses some of the facilities in the AppKit without being an app.

Ali
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:03 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2