• 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: Foundation Tool, readf, stdio, question!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Foundation Tool, readf, stdio, question!


  • Subject: Re: Foundation Tool, readf, stdio, question!
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 9 Oct 2008 06:21:40 -0500

On Oct 8, 2008, at 11:44 PM, Luis Rojas wrote:

I am trying to make a tool that uses cocoa classes but i am stuck in one
basic point. How do i read text on the terminal? and where can i find more
information if i want to make cocoa applications that is main interface is
the terminal.

Cocoa doesn't necessarily provide classes to take over every task you might ever want to do. In particular, there's a reason that Objective- C is a superset of C -- it lets you keep using C wherever that's more appropriate.


I expect you'll find that for what you're trying to do (reading text on the terminal), stdio is still the best approach.

Of course, there's no reason that you can't mix Cocoa in with such code. For example, creating an NSString from the text that you've read, or using arrays and dictionaries for data storage, etc.

If you really feel the urge to go all Cocoa, +[NSFileHandle fileHandleWithStandardInput] gives you an object for reading from standard input. However, it doesn't include convenient methods for line-based input.

Cheers,
Ken

_______________________________________________

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: 
 >Foundation Tool, readf, stdio, question! (From: "Luis Rojas" <email@hidden>)

  • Prev by Date: Re: corrupt coredata DB
  • Next by Date: Re: Mirror...rorriM : Details Please
  • Previous by thread: Foundation Tool, readf, stdio, question!
  • Next by thread: Newb Question about Delegtes and callbacks
  • Index(es):
    • Date
    • Thread