• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C and objective C together
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >C and objective C together (From: Jason Reece <email@hidden>)

  • Prev by Date: Drawing a Grid in a TableView
  • Next by Date: Re: Malloc()
  • Previous by thread: Re: C and objective C together
  • Next by thread: Re: C and objective C together
  • Index(es):
    • Date
    • Thread