Sign in to follow this  

Objective-C Command Line

This topic is 1952 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys!

I'm working in Objective-C at the moment as i am too broke to buy any C# books and instead of working with Cocoa for a graphical app at present, I am trying to get the basics down in a command line app.

My question is: Is there any way to get input from a command line app, or is it all just output? cin and cout from C++ don't work, but printf does from C.

Basically, I just want to be able to have a user type in a word, check it against a switch and output a string. Pretty simple, considering what Objective-C and C++ can do. I'm just hitting a wall that my current book doesn't overcome.

Or if anyone has any simple explanation of how ot connect a button to my code in Xcode for a cocoa app, that'd work too!

Thanks guys!

Share this post


Link to post
Share on other sites
Well, if printf works, I'm guessing [b]scanf[/b] will probably work too.

If it's not in your book, then it's a shame there isn't some kind of [url="http://lmgtfy.com/?q=objective+c+reading+from+command+line"]vast interconnected library you could access[/url].... [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img]

Share this post


Link to post
Share on other sites
Lol, thanks ChaosEngine!

I had done a brief scan of the web for an answer, but I could probably be given the title of World's Worst Googler and found nothing the first couple attempts. I have since found that scanf works, I just gotta remember how to use it for strings.

Share this post


Link to post
Share on other sites

This topic is 1952 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this