Re: plist help?
Re: plist help?
- Subject: Re: plist help?
- From: Ali Ozer <email@hidden>
- Date: Sat, 20 Sep 2003 12:01:17 -0700
char* cstr = (char*)[filename cString];
Note that when something is declared to return a (const char *),
casting it to a (char *) is not a good idea, as the compiler will no
longer catch potentially invalid modifications of that string.
More importantly, please, do not use the cString method for extracting
8-bit file names from NSStrings. It just won't work with international
file names, and in some user environments, it might even fail to work
with plain old ASCII.
In fact, do not use cString and related methods at all, as they are
being deprecated.
For filenames, if you must extract them as 8-bit, use the NSString
method fileSystemRepresentation, declared in NSPathUtilities.h.
But what's even better is if you can avoid extracting 8-bit strings
from NSStrings as much as possible. For instance everything you are
doing in your code you can do with the functionality in
NSPropertyListSerialization.h and NSData.h
Ali
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.