Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8631635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:14:44+00:00 2026-06-12T09:14:44+00:00

I successfully use NSFileHandle to read keyboard input: NSFileHandle * keyboard = [NSFileHandle fileHandleWithStandardInput];

  • 0

I successfully use NSFileHandle to read keyboard input:

NSFileHandle * keyboard = [NSFileHandle fileHandleWithStandardInput];
NSData *inputData = [keyboard availableData];
NSString * input =[[NSString alloc] initWithData:inputData encoding:NSUTF8StringEncoding];

As the user types, only the first character of input is echoed on the screen. For example, if I type hello, only h is echoed on the screen. However the full input is read into the string.

The proper echo behavior works in Xcode 4.2. I’m currently using Xcode 4.5.

UPDATE

Giving up on NSFileHandle for now, I tried to use scanf. However there’s the same echoing issue. scanf code:

char word[4];
scanf("%s",word);
NSString * input = [[NSString alloc] initWithBytes:word length:4 encoding:NSUTF8StringEncoding];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:14:44+00:00Added an answer on June 12, 2026 at 9:14 am

    This is a bug in Xcode 4.5. When the console is refreshed all echoed input is revealed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I've tried successfully - Use Modernizr to detect Modernizr.input.required, with fallback on custom
I have a ant target where I successfully use a sshexec-task to install a
What JavaScript framework do you use successfully with Trigger.io? I mean client side JS
Background Our email vendor supports rss feeds for dynamic content, which we use successfully
I am trying to use the Google Map API- I've successfully managed to add
I successfully compiled ActionBarSherlock in Eclipse. But I get 75 errors when I use
I was trying to use jQuery's page scroll inside some pages and could successfully
I use SpringSource Tool Suite 3.0.1, Tomcat server 7.0.21, maven-2.2.1. I successfully built my
I'm using the following code successfully with HTTP but I would like to use
In my application I use MessageDigest.getInstance(SHA-1) to get SHA1, it can run successfully in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.