Re: File processing with Obj-C & Cocoa
Re: File processing with Obj-C & Cocoa
- Subject: Re: File processing with Obj-C & Cocoa
- From: Adam P Jenkins <email@hidden>
- Date: Sat, 16 Feb 2008 01:11:20 -0500
On Feb 15, 2008, at 10:23 PM, Ken Thomases wrote:
On Feb 15, 2008, at 7:22 PM, Bryan Robinson wrote:
I'm a long time C++ developer who has recently started with Obj-C and
Cocoa. I love it so far, but I have come up against an issue that
has
stumped me: how do I processes a structured text file (utf-8) with
the
Cocoa and Obj-C?
In addition to what others have said, I would just reassure you that
you should feel free to continue to use C++ (or drop down to C) if
that's the best fit for your needs.
There's a reason that Objective-C was built on top of C. ;)
I won't discourage you from seeking The Cocoa Way to do stuff, but
sometimes there just isn't a Cocoa- or Objective-C-specific way to
do it. You just do it the same way you do it in any other language.
Reading and writing text files seems to be one of those areas for
which Cocoa has very poor support compared to C++ or Java. Unless
your files are small and you can just use one of the methods on
NSString to read or write a whole file at once, you're kind of on your
own. So I'd say keep using the C++ library for that if you're already
comfortable with iostreams. If you can choose the file format and
you don't need it to be human readable, then NSArchiver/NSUnarchiver
are a convenient option.
_______________________________________________
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