• 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
Modal Dialog Issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modal Dialog Issue


  • Subject: Modal Dialog Issue
  • From: "Carmen Cerino Jr." <email@hidden>
  • Date: Mon, 3 Nov 2008 09:22:25 -0500

I have a button that when clicked will display a modal dialog. My
modal dialog is custom, and lives in its own Xib file. My issue is
that the first time I click the button to make the dialog appear it
does not latch it self onto the window like it should. If I go to
dismiss the dialog with my cancel button, the dialog does not
disappear but focus returns to my main window. Now the strange thing
is if I go to click that button again, the modal dialog works as it
should.
My code is as follows:

- (IBAction)signIn:(id)sender{
   if(!ibUserAuthenticationWindow) {
      [NSBundle loadNibNamed: @"UserAuth" owner: self];
   }

   [NSApp beginSheet: ibUserAuthenticationWindow
      modalForWindow: ibMainWindow
       modalDelegate: self
      didEndSelector:  @selector(didEndSheet:returnCode:contextInfo:)
         contextInfo: nil];
}

- (IBAction)authenticationCancel:(id)sender
{

   [NSApp endSheet:ibUserAuthenticationWindow];

}

- (void)didEndSheet:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo{
   [sheet orderOut:self];

}

Cheers,
Carmen
_______________________________________________

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

  • Prev by Date: Re: Subview frames and bounds
  • Next by Date: Lack of Initializers or Factory Methods
  • Previous by thread: Re: Subview frames and bounds
  • Next by thread: Re: Modal Dialog Issue
  • Index(es):
    • Date
    • Thread