Is there anyway we can take input from command line in Objective-C, the way we can take in C/C++
e.g;
int inputVariableName;
cin>>inputVariableName;
Is there anyway we can take input from command line in Objective-C, the way we can take in C/C++
e.g;
int inputVariableName;
cin>>inputVariableName;
Sure. Compile your code as Objective-C++.
This is typically as easy as renaming the file from having a .m suffix to a .mm suffix.
Documentation is included with the Xcode tools as to the details of Objective-C++.
scanf("%i", userInput);
just as you would in c
To get Objective-C objects from the input, simple convert them after reading them in:
NSNumber * number = [nsnumber numberwithint:useriput];
As bbum mentioned, you can use NSFileHandle to get access to stdin. If you just want to read the command line arguments, you can get them from [[NSProcessInfo processInfo] arguments]. It's also worthwhile to know what else NSProcessInfo can tell you.