Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDocument read/write cycle issue



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 whitout 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 () );

When is windowControllerDidLoadNib called (which seems to allocate my GUI
elements), or do i need to call some constructor myself?


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.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.