Re: NSCreateCommand
Re: NSCreateCommand
- Subject: Re: NSCreateCommand
- From: "Jim O'Connor" <email@hidden>
- Date: Sun, 24 Jul 2005 16:02:08 -0500
Well, I thought that if my init call wasn't ever made, then my
performDefaultImplementation call didn't stand a chance of being
called, however, it is (now that I've added it).
Can someone explain why my init method isn't called?
Thanks for the reply,
Jim
On Jul 23, 2005, at 9:16 PM, Stephen McIntosh wrote:
Hi Jim
You need to override the
- (id)performDefaultImplementation
method of NSCreateCommand in you MyCreateCommand class.
Hope this helps
Regards
Stephen
On 24/07/2005, at 9:26 AM, Jim O'Connor wrote:
What do I need to do to subclass NSCreateCommand and get my
subclass called?
Apparently it isn't as easy as changing sdef to:
<suite name="Standard Suite" code="????"
description="Common classes and commands for all
applications.">
<!-- intervening lines deleted because they are uninteresting -->
<command name="make" code="corecrel" description="Make a
new object.">
<cocoa class="MyCreateCommand"/>
<parameter name="new" code="kocl" type="type"
description="The class of the new object.">
<cocoa key="ObjectClass"/>
</parameter>
<parameter name="at" code="insh" type="location
specifier" optional="yes"
description="The location at which to insert the
object.">
<cocoa key="Location"/>
</parameter>
<parameter name="with data" code="data" type="any"
optional="yes"
description="The initial contents of the object.">
<cocoa key="ObjectData"/>
</parameter>
<parameter name="with properties" code="prdt"
type="record" optional="yes"
description="The initial values for properties of
the object.">
<cocoa key="KeyDictionary"/>
</parameter>
<result type="specifier" description="to the new
object"/>
</command>
With the relevant change being "MyCreateCommand" instead of
"NSCreateCommand".
MyCreateCommand has its own init call, which is never called.
My reason for doing this is that I need to create documents in a
way other than simply calling init on a document. I need to make
the NSDocumentController create the standard untitled document.
Thanks,
Jim O'Connor
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40ozemail.com.au
This email sent to email@hidden
_______________________________________________
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