I have this shell command that return xml data.
I’m new to Objective-C. I want to load in some XML using the system() function.
Can anyone help me or point me in the right direction?
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t use
system()for that, because it doesn’t return any data from the command to you. Instead, all of the program’s output will go to the terminal.The Cocoa way to do this is
NSTask.You need to:
setLaunchPathand optionallysetArgumentsto specify what program to runNSPipetosetStandardOutputlaunchthe program