Re: 3rd party executable in iOS project
Re: 3rd party executable in iOS project
- Subject: Re: 3rd party executable in iOS project
- From: Jens Alfke <email@hidden>
- Date: Mon, 21 Oct 2013 19:59:14 -0700
On Oct 21, 2013, at 6:26 PM, Koen van der Drift <email@hidden> wrote:
> The question now is, how do I call the functions in this library?
> On the command line, I need to do something like this:
> foo file1 > output
> With NSTask and companions it is easy to do this, but how can I do that for iOS where NSTask is not present?
If it really is a library, then it has an API with functions as the entry points. Call those.
If not, you’ve got more work to do — you can rename its main() function to something like “library_main”, then call that from your code with the desired arguments in its argc and argv parameters. But look through the main() function to make sure it’s not calling exit() anywhere, because if it does it’ll quit your app.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden