NSTask or equivalent for iPhone [closed]

狂风中的少年 提交于 2019-12-28 03:10:05

问题


I've an open source project (gdal) that I want to compile and run as part of an iOS app. I had been expecting to use NSTask but I see now that it was removed in iOS 3.0. I've also seen elsewhere that running external applications, though this would be a resource in my app's bundle, is not allowed.

Has anyone else found a way to run commandline tools within their iOS applications?


回答1:


It wasn't removed in 3.0, it was never there. There is no way to run separate processes on the iPhone. GDAL appears to be under an MIT style license and has a library interface, so directly linking it into an iPhone app shouldn't have any legal or technical issues.




回答2:


NSTask is available in ios 4, ios 3 and possibly all of them. To use NStask I had to copy the NStask header file from my mac to my project folder. Also Apple will most likely not allow an app that uses NStask in the appstore. Cydia would probably be the best place to distribute your app




回答3:


Just reminder:
NSTask will not work under sandbox environment (you will get "deny process-fork"). So put your application into /Applications



来源:https://stackoverflow.com/questions/1536400/nstask-or-equivalent-for-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!