• 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
Which to subclass?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Which to subclass?


  • Subject: Which to subclass?
  • From: Mike Abdullah <email@hidden>
  • Date: Thu, 5 Jan 2006 15:57:28 +0000

Hi, I am fairly new to Cocoa and am after some advice on how best to create the kind of document structure I require. I would be very much obliged if someone where able to help.

At present, all I have is a simple Cocoa Document project, created by choosing "New Document-based Cocoa app" from the project window. So this gives me 2 nibs, one for the menu bar and one for the document windows. I also have a subclass of NSDocument called "MyDocument" (that's the default, I intend to change it at some point). This is the "File's Owner" of the document nib and I have the appropriate .h and .m files to match.

What I require of my app is this:
1. The user opens a new document (it doesn't matter how - run the app, choose File - New, either will do)
2. Before any windows have appeared on the screen, a simple applescript is run (I think I already know how to do this bit)
3. Depending on the results returned by the script, either:


The document window is brought up with some text fields filled in from the script results

OR

The document window is brought up but with a sheet over it asking the user what they would like to do

So what I am wondering is what exactly do I need to subclass to achieve this? Is it sufficient to subclass NSDocument, and which case in what method should I place the code that runs the applescript? Or do I also need to subclass NSWindowController or something else?

Thanks in advance (hopefully!)
Mike A.

_______________________________________________
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


  • Prev by Date: Re: non-closeable drawer?
  • Next by Date: Re: Internationalization support
  • Previous by thread: Re: non-closeable drawer?
  • Next by thread: About box appearing below utility panels
  • Index(es):
    • Date
    • Thread