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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to