Re: saving tables and user defined strings
Re: saving tables and user defined strings
- Subject: Re: saving tables and user defined strings
- From: Ondra Cada <email@hidden>
- Date: Tue, 14 Aug 2001 22:20:23 +0200
Mark,
>
>>>>> Mark Wridt (MW) wrote at Tue, 14 Aug 2001 12:27:52 -0700 (PDT):
MW> I have created an NSTableView app with some parsed
MW> info from files. Two problems:
MW>
MW> 1) The file paths are hardcoded into the program. The
MW> user should define them. In C++, you could cout <<
MW> "Enter file name" (and then cin) >> a string.
MW> (of course in a PC cousel environment)
If you want a console i/o, the standard stdin/stdiout are here for you.
MW> How does one accomplish this in cocoa? NSTextView
MW> perhaps? How do you implement it?
But of course, in GUI applications textfields in a reasonable panel are the
answer. And/or defaults database for things which should seldom change.
MW> 2) I would like to be able to save the created table.
MW> How does one implement the "save" functionality in
MW> the applictaion bar?
I don't quite understand, but, if it is what you want, any property list
(structure made of NSArrays, NSDictionaries, NSStrings, NSNumbers, etc.) can
be easily saved using writeToFile:atomically: and readed back by
initWithContentsOfFile:. RTFM.
OTOH, if you want to store the table layout, again RTFM, this time
NSTableView.html (I guess in the newest IB you can set it even in inspector,
but I am not quite sure -- I mostly use MOSXS1.x, where it was not possible).
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc