• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Standard input/output in Objective-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Standard input/output in Objective-C


  • Subject: Re: Standard input/output in Objective-C
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 23 Mar 2010 15:18:59 -0700


On Mar 23, 2010, at 2:44 PM, Mikael Wämundson wrote:

inputData = [fileHandle availableData];
inputString = [[NSString alloc] initWithData: inputData encoding:NSUTF8StringEncoding];
[aPerson setPersonsFirstName: inputString];

You could just call fgets and then convert the resulting C string to an NSString.


I think the reason there isn't anything "Cocoa-like" for this is that hardly anyone uses Objective-C to write interactive console tools.

—Jens_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Standard input/output in Objective-C (From: Mikael Wämundson <email@hidden>)

  • Prev by Date: Re: Standard input/output in Objective-C
  • Next by Date: Re: Which iPhone Program?
  • Previous by thread: Re: Standard input/output in Objective-C
  • Next by thread: How to eliminate field editor from NSTextField?
  • Index(es):
    • Date
    • Thread