Re: Document based app problems
Re: Document based app problems
- Subject: Re: Document based app problems
- From: April Gendill <email@hidden>
- Date: Sun, 4 Jan 2004 09:11:44 -0700
On Jan 4, 2004, at 3:36 AM, mmalcolm crawford wrote:
On Jan 3, 2004, at 10:19 PM, April Gendill wrote:
On Jan 3, 2004, at 1:57 PM, Shawn Erickson wrote:
On Jan 3, 2004, at 12:47 PM, April Gendill wrote:
I tried foolishly to create a document based application. 2 things
happen
When I save the document, close the application and then double
click the document certain things become inaccessable. The Document
is based on 1 dictionary and one array. It's the dictionary that I
cannot access at all. If I log the dictionary, it is all there.
However, I cannot access ANYTHING FROM ANYWHERE including from
within the document class. I have tried making accessors but no
matter what they return nil. I can access the dictionary outside
the document class but I cannot extract anything from it.
second Absolutely nothing I do allows me to access ANY NSTextfield.
I cannot retrieve data from them or set their values
finally, if I doulbe click a document the app opens or it opens the
doc, if I close the document and double click the icon, of if I
double click the icon with no other windows open in the app, it
crashes, sigbus 10
Very hard for us to help without a better description of what you
are doing in your code, showing code is the best way.
Basically how are you saving the data into your document and how are
you getting it back out of your document.
I was using the built in stubs when you start a doc based app in
xcode.
Basically I just turned the entire thing into a dictionary. Not to
hard. two objects to add too it is all. And saved it to disk
then simply restore the dictionary.
resotredDictionary = [someString propertyList]
someDict setDictionary:retoredDictionary
How is the NSTextField issue related to your document or is it?
Because among other things I cannot seem to retrieve ANY information
from documents after they are saved I can nslog the variables they
get put into and the info is there it's just inaccessable.
Part of the textfield problem it would seem however was that I had
named the two textfields i needed to set something that xcode or IB
or something did not like. I changed the names and they started to be
settable from other sources. I still cannot get the save and restore
to work though.
Sorry, this still doesn't help very much.
I suspect you're (a) not retaining the data you read in from the file,
and (b) not replacing your instance variables appropriately, but
without seenig your actual code it's difficult to tell.
A number of the controller examples I put at:
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
illustrate how to save and load files...
Because it did not work I canned the code, I'll look over the examples
and try again. If it still does not work I'll C&P the code and send it
to the list. Thank you for the link BTW I will probably have a chance
to work on this tonight.
April.
mmalc
_______________________________________________
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.