2

I have a C code which embeds Lua interpreter and some scripts. These scripts relies on stdin/stdout for user input/output.

I am trying to write a simple cocoa application with single NSTextField which will act as a stdin/stdout for my C code.

I was able to bind stdout as explained on this link: What is the best way to redirect stdout to NSTextView in Cocoa?

How do I bind stdin with my NSTextField? ( In simple word, "scanf" should be able to receive input from text field. )

NOTE: I don't want to use NSTask. My C code has to be part of my cocoa app. ( basically there is no sub-process )

Community
  • 1
  • 1
Icarus3
  • 2,310
  • 14
  • 22

0 Answers0