views:

185

answers:

1

Hey guys,

I'm an absolute noob at iPhone development but I know a little C. I need to know how to execute an executable program (compatible under OS X) for an iPhone application. I know that in C system() can be used to invoke a separate program. The program has been tested on the mac terminal and works without any flaws. In addition, that program is part of a library deemed platform independent, meaning that it has programmatic support for multiple operating systems.

A question that derives from the last one is: would an OS X compatible executable reliably work on the iPhone OS as well? I know that the iPhone OS is very similar to its counterpart.

Thanks for any help.

+7  A: 

The App Store User Agreement forbids system calls. You may not include any external programs with your app. NSTask (which is for executing programs in Cocoa) is NOT included with the iPhone OS. If you have the source to the C (or c++) file, you can compile it with your program and actually call the functions you need.

Its a sad, but true, reality :(

micmoo
Thanks for saving me a lot of trouble. I owe you one.
obsoleteModel81
No problem! It took me a WHOLE lotta time figuring that one out for myself!!! The worst part is, system calls work FINE in the Simulator! So I had an app all working, I loaded it up on my iphone... and nothing. That was truely depressing! It wasn't anything exciting, just a little helper I wrote for chem class...I had the C++ source for half of it, so I just compiled it and called the function using OBjective-C++...Oh God, I just randomly ranted... So sorry, that's what I get for going on SO at 4AM...
micmoo