• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSCreateCommand
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCreateCommand


  • Subject: Re: NSCreateCommand
  • From: Stephen McIntosh <email@hidden>
  • Date: Sun, 24 Jul 2005 12:16:47 +1000

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
  • Follow-Ups:
    • Re: NSCreateCommand
      • From: "Jim O'Connor" <email@hidden>
References: 
 >NSCreateCommand (From: "Jim O'Connor" <email@hidden>)

  • Prev by Date: (no subject)
  • Next by Date: Re: Simple noob question
  • Previous by thread: NSCreateCommand
  • Next by thread: Re: NSCreateCommand
  • Index(es):
    • Date
    • Thread