• 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: Linking an NSWindow in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking an NSWindow in IB


  • Subject: Re: Linking an NSWindow in IB
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 31 Aug 2011 20:04:30 -0700

MYWindow isn’t a window, it’s an NSObject that can act as a window delegate. So creating one isn’t going to create a window. You don’t have any code that creates a window; there’s a window property but nothing that sets it. Also, you’re calling a -showWindow: method on your MyWindow class, but you never defined or implemented such a method.

What you want to do is

- Add a window to your main nib/xib file.
- Add a MyWindow object too (drag in a generic object and set its class to MyWindow)
- Wire the window up to the MyWindow (control-drag from MyWindow to the NSWindow and select the “window” outlet)
- Create another IBOutlet variable in your app delegate’s class, of type MyWindow* … let’s say it’s named myWindow.
- Wire that up to the MyWindow object in the nib.
- Now to display the window your app delegate calls [[myWindow window] makeKeyAndOrderFront: self]

I haven’t looked at the tutorials and intro docs in a while, but there must be some that cover this stuff.

—Jens_______________________________________________

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

References: 
 >Linking an NSWindow in IB (From: Guy Halford-Thompson <email@hidden>)
 >Re: Linking an NSWindow in IB (From: Ron Fleckner <email@hidden>)
 >Re: Linking an NSWindow in IB (From: Guy Halford-Thompson <email@hidden>)

  • Prev by Date: Re: Linking an NSWindow in IB
  • Next by Date: Re: Linking an NSWindow in IB
  • Previous by thread: Re: Linking an NSWindow in IB
  • Next by thread: Re: Linking an NSWindow in IB
  • Index(es):
    • Date
    • Thread