• 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: call C application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call C application


  • Subject: Re: call C application
  • From: "Jordan Krushen" <email@hidden>
  • Date: Thu, 27 Apr 2006 15:32:36 -0700

On 4/27/06, Mai Bui <email@hidden> wrote:

> - and press "STOP" button, it send 'q' character to the running
> application to stop that application and then quit its self (the
> cocoa application).

When you say "send 'q' character", do you mean a 'q' keystroke (like a
curses app), or text fed to its stdin?  If the former, I don't think
NSTask will do the trick.  I'm sure others can give advice on how to
handle terminal-manipulation from Cocoa, but I wouldn't expect
anything easy..

> Yes, I tried to use NSTask, it seems to work. (it can launch my C
> app, not stop though - I will work on it!).

See -[NSTask terminate].

> But, I have another question: In my cocoa app I have a window to
> display out put.  How can I make "printf()" in my C app into this
> display window?

Reading from the pipe connected to your C app's stdout will provide
you with its output.  Again, see the NSTask docs for details:
http://developer.apple.com/documentation/Cocoa/Conceptual/OperatingSystem/index.html

J.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: call C application
      • From: Mai Bui <email@hidden>
References: 
 >call C application (From: Mai Bui <email@hidden>)
 >Re: call C application (From: "email@hidden" <email@hidden>)
 >Re: call C application (From: Ondra Cada <email@hidden>)
 >Re: call C application (From: Mai Bui <email@hidden>)

  • Prev by Date: Re: -[NSAttributedString initWithData:...] compresses spaces?
  • Next by Date: Re: -[NSAttributedString initWithData:...] compresses spaces?
  • Previous by thread: Re: call C application
  • Next by thread: Re: call C application
  • Index(es):
    • Date
    • Thread