• 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: Calling you...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling you...


  • Subject: Re: Calling you...
  • From: Thomas Deniau <email@hidden>
  • Date: Sat, 26 Jan 2002 13:06:31 +0100

Le 26/01/02 12:52, Riccardo Santato disait :

> - (void) buttonAction:(id)sender+
> {
> Second_Class *mw;
> mw=[[Second_Class alloc] init];
> [mw openWindow];
> }
>
> while in the "second_class":
>
> -(void)openWindow
> {
> [second_window makeKeyAndOrderFront:self];
> [NSApp runModalForWindow:second_window];
> }
>
> I would add these: the outlets are rightly set, the "runModalForWindow"
> tells me that "Modal session requires modal window" and the
> "second_window" is not displayed. Why ? I've checked Gunnar source code
> but it does the very same things as me.. Where's my error ?
> Please excuse my poor programming technique.

If you get an instance of your class using alloc] init] then its outlets
won't be set.
You must either use an outlet in first_class to the nib instance of
second_class, either put second_class and second_window in another nib and
use -[NSBundle loadNibNamed:owner:]

Or, if you don't want a modal window, you can simply make a connection from
the button to the window and select the action makeKeyAndOrderFront:

--
Thomas Deniau


References: 
 >Calling you... (From: Riccardo Santato <email@hidden>)

  • Prev by Date: Calling you...
  • Next by Date: Re: Localized questions
  • Previous by thread: Calling you...
  • Next by thread: Drawing 2D / NSQuickDrawView
  • Index(es):
    • Date
    • Thread