• 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: Custom sheet question - which variable?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom sheet question - which variable?


  • Subject: Re: Custom sheet question - which variable?
  • From: Jenny M <email@hidden>
  • Date: Sun, 10 Jan 2010 20:25:38 -0800

Ah! Duh, thanks. So my related question is, I have the NSWindow object is a
separate xib file, and that xib file's "File's Owner" is of a custom
NSWindowController class, so how would I link the window inside the
"NewObject" xib to the main application controller? The Apple documentation
indicates it is possible to have these in separate xib files, but I don't
see how to link them.

What I'm trying to do is this. I have a main window with a button to say
"Create New", and I have an NSWindowController class to handle the
creation/check/storage of that new object. I have a separate xib file to
handle that window and object. But I want the main window to open the 'new
object' window as a sheet (and in fact I need to have cascading sheets of
different types). Does this seem possible keeping everything in separate
xibs with separate controllers?

Thanks...


On Sun, Jan 10, 2010 at 10:26 AM, Hank Heijink (Mailinglists) <
email@hidden> wrote:

> That example assumes you have an instance variable called myCustomSheet in
> your class. You can tell from the method signature of the following method
> (called in the example you refer to) what type it should be:
>
> - (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow
> *)docWindowmodalDelegate:(id)modalDelegate
> didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo
>
> Thus, myCustomSheet is an instance of NSWindow.
>
> Cheers,
> Hank
>
> On Jan 9, 2010, at 9:40 PM, Jenny M wrote:
>
> > Hi, I have what may seem like a very stupid question about custom sheets.
> I
> > am following this Apple dev tutorial:
> >
> http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Sheets/Tasks/UsingCustomSheets.html
> >
> > and I'm looking at this piece of code here:
> >
> > if (!myCustomSheet)
> >    //Check the myCustomSheet instance variable to make sure the custom
> > sheet does not already exist.
> >    [NSBundle loadNibNamed: @"MyCustomSheet" owner: self];
> >
> > But, I have no idea what "myCustomSheet" is referring to. I know that
> > "MyCustomSheet" is the separate XIB file, but of what variable type is
> > "myCustomSheet"? Do I need to define and connect to it in the new XIB?
> >
> > Thanks.
> > _______________________________________________
> >
> > Cocoa-dev mailing list (email@hidden)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> >
> > This email sent to email@hidden
> >
>
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Custom sheet question - which variable?
      • From: Jerry Krinock <email@hidden>
References: 
 >Custom sheet question - which variable? (From: Jenny M <email@hidden>)
 >Re: Custom sheet question - which variable? (From: "Hank Heijink (Mailinglists)" <email@hidden>)

  • Prev by Date: Re: How to know whether property in Cocoa class is KVO-compliant?
  • Next by Date: Re: How to know whether property in Cocoa class is KVO-compliant?
  • Previous by thread: Re: Custom sheet question - which variable?
  • Next by thread: Re: Custom sheet question - which variable?
  • Index(es):
    • Date
    • Thread