• 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: Single instance of properties window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Single instance of properties window


  • Subject: Re: Single instance of properties window
  • From: Derrick Bass <email@hidden>
  • Date: Mon, 3 Oct 2005 12:59:25 -0500

On Oct 3, 2005, at 12:49 PM, Sherm Pendley wrote:
Create an NSWindowController subclass that has a class method to return a shared instance:

+ (id) sharedPropertiesController {
static MyPropertiesController *controller;
if (nil == controller) {
controller = [[MyPropertiesController alloc] initWithWindowNibName:@"Properties" owner:self];
}
return controller;
}


Note that this controller, since it's shared instead of being associated with a single document, should *not* be owned by an NSDocument instance. In your document class, you'd do something like this to show it:

[[MyPropertiesController sharedPropertiesController] showWindow:self];


But wouldn't that mean I'd have only one properties window for the entire app? That's not what I'm after. I want the user to be able to open one properties window for each document. (Like the QuickTime Player 7 Properties window.)


Derrick

_______________________________________________
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: Single instance of properties window
      • From: Sherm Pendley <email@hidden>
References: 
 >Single instance of properties window (From: Derrick Bass <email@hidden>)
 >Re: Single instance of properties window (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Single instance of properties window
  • Next by Date: Cannot Save Britney Spears
  • Previous by thread: Re: Single instance of properties window
  • Next by thread: Re: Single instance of properties window
  • Index(es):
    • Date
    • Thread