This line of code:
system("/Applications/Xcode.app/Contents/Developer/usr/bin/opendiff /Users/LukeSkywalker/Documents/doc1.rtf /Users/LukeSkywalker/Documents/doc2.rtf");
gives me this warning:
'system' is deprecated: first deprecated in iOS 8.0 - Use posix_spawn APIs instead.
I've read a little bit about posix_spawn, but I can't figure out what an equivalent line of code using posix_spawn would look like.
Any help or links to samples would be appreciated.
Using
posix_spawn()
, to answer your question:(...)
Or, you could use NSTask:
If you don't need it to be synchronous, just remove the call to
waitpid()
(make sure to call it somewhere else, or you'll end up with a zombie process until your app exits) or[task waitUntilExit]
.