NSDocument read/write cycle issue
NSDocument read/write cycle issue
- Subject: NSDocument read/write cycle issue
- From: Wolfram Stebel <email@hidden>
- Date: Fri, 28 Oct 2005 10:10:12 +0200
Hi list,
i'm new to this list and did not find any hints for my problem searching it.
I also searched the Apple examples whithout success.
So this is my problem:
i have a java cocoa application using Coreaudio.
it has a multiple document interface with a subclass MyDocument (extends
NSDocument).
i already found the essential methods for reading and writing data.
i tried it with
public boolean writeToFile ( String fileName, String docType )
public boolean readFromFile(String fileName, String docType)
using FileInput-/OutputStreams. I can simply read and write what i need to.
and also
public NSData dataRepresentationOfType ( String aType )
public boolean readFromDataOfType ( NSData data, String typeName )
Anyway the docs on those methods are very strange, i.e. showing several
"deprecated" infos.
***
I need to solve:
MyDocument contains NSTextField, NSProgressIndicator and NSSlider, who's
current status i want to archive in the document.
How do i best read/write such data?
When are the GUI elements created, so that i can assign the values from
file? The code below shows that i can read from the file, but cant set the
member (setupMin is null in this moment!):
// public boolean readFromDataOfType ( NSData data, String typeName )
// int v = data.readInt ();
// if ( setupMin != null )
// setupMin.setObjectValue ( new Integer ( v ).toString () );
So finally:
Where can i find a receipe how to read/write files according to the cocoa
framework?
Does someone have a short introduction for me?
Thanks for your support!
Wolfram
P.S. I'm developing object oriented software for many years with several
class libs now, but can't find a consistent way through this...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden