NSDocument help
NSDocument help
- Subject: NSDocument help
- From: Sailor Quasar <email@hidden>
- Date: Wed, 4 Jun 2003 12:53:01 -0400
I'm pretty new to Cocoa and to the AppKit specifically, and I need some
help on what I'm sure seems a very simplistic question regarding
NSDocument-based applications.
I need the NSDocument to always be considered dirty (needs saving), to
never display a save panel (I want the save name to be the title of the
document's single window), and to automatically save on a -close (or
related) message using my override of -writeToFile (and other
primitives). I think I've got most of it, but I can't quite get how to
get it to skip the save panel.
On a not-really-related question, I found myself using this code
snippet to pass a message to a delegate from
-canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:
objc_msgSend(delegate, shouldCloseSelector, self, YES, contextInfo);
This seems like an unnecessary use of an ObjC runtime function to me,
but NSObject's performSelector:withObject: and
performSelector:withObject:withObject: didn't quite seem to fit. Should
I have used
[delegate performSelector:shouldCloseSelector withObject:(id)YES
withObject:contextInfo];
?
Doing that typecast to id for the BOOL feels wrong to me as someone
with long experience with C and C++ :). Am I missing the obvious
somewhere?
-- Sailor Quasar, just another player in The World
"Come with me in the twilight of the summer night for awhile"
Email: email@hidden
_______________________________________________
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.