 |
 |
ObjC and CLI applications
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2001
Location: Areas 51 thru 55 :P
Status:
Offline
|
|
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
|
|
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
|
|
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'
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Sep 2000
Status:
Offline
|
|
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
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|