Re: writeToFile:
Re: writeToFile:
- Subject: Re: writeToFile:
- From: Isaac Sherman <email@hidden>
- Date: Mon, 17 Feb 2003 16:32:12 -0500
on 2/17/03 4:03 PM, the method -(id)email@hidden:(id)
sender:@"Hussain Bandukwala"; returned:
>
Hi All,
>
>
I've been experiencing problems with the writeToFile: method for the
>
NSDictionary class. I would like to write a dictionary's contents to a .txt
>
file. I've already created the required .txt file and placed in the folder of
>
the application. I have also added the .txt file as a resource within the
>
application through Project Builder. The following is the code that I am
>
using:
<snip>
>
Is it even possible to write a dictionary to a .txt file? Am I missing
>
something? Any other suggestions for doing what I need to do?
I don't believe it is; use .plist, and then if you don't like Property List
Editor, open plists with BBEdit or something similar. You're also only able
to write Numbers, Booleans, Strings, Data, and Dates to plists, in
Dictionary or Array form. If you want to encode a custom class, break it
down, or use NSArchiver.
Incidentally, does writeToFile: send that message to each of it's contained
objects (in the case of a dictionary or array, of course)? Just curious.I
don't know, but if it is true, you _could_ store custom classes in .plist
form, relatively easily. Hmm...
Hope this helps,
--
Isaac Sherman
MotaSoft Software
http://homepage.mac.com/huperzoevs/
_______________________________________________
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.
References: | |
| >writeToFile: (From: "Hussain Bandukwala" <email@hidden>) |