Hey guys. So, I'm trying to have my iPhone app (jailbreaked) run a terminal command, and show the output. For those who don't see what I mean, I want to do the same thing as Cydia does when installing a package (b开发者_运维问答lack screen with the command output)
I'm using xCode 4.
Thanks!
Cydia is not directly running external programs: it is linked against libapt-inst, which indirectly runs dpkg to generate some (but not all) of that output.
In general, you just want to render a black text box with some white text, and then use popen
to run your external program, fread
ing any data from the pipe into your app to add to the end of the box.
精彩评论