Re: C and objective C together
Re: C and objective C together
- Subject: Re: C and objective C together
- From: Markus Hitter <email@hidden>
- Date: Wed, 3 Apr 2002 06:01:12 +0200
Am Dienstag den, 2. April 2002, um 21:15, schrieb Jason Reece:
I have a C program that I'm porting to Cocoa. As, the bulk of the
program is just number crunching I'm leaving it as C. However, the
program produces text messages while it is running via printf's. How do
I 'catch' these and display them on a window?
Depending on how much interaction you need, how about putting
the C tool as is into your app's bundle, find it with one of the
NSBundle methods, then use popen() or NSTask to launch it? To
forward the text, you could use NSFileHandle's
-readInBackgroundAndNotify.
Slightly more inefficient to use a own process instead of using
NSThread, but lot's easier to code.
Cheers,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.