Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 24, 2009, 08:19 PM   #1
Duke Leto
macrumors regular
 
Join Date: Mar 2008
Opening a Window

I want the user to be able to open a window from another xib file by clicking a button. I created an NSWindowController subclass. It has an open: action connected to the button, its window is connected to the window, and it is the File Owner of the xib containing the window. The open: method calls loadWindow and showWindow:, but the window does not appear.

The problem appears to be that the window variable shows up as 0x0. Why is it nil, and how can I fix it?

P.S.
I know that I have been using this forum as a crutch for what I do not know about development. Please bear with me, as I am coming from iPhone programming - where I insisted on programmatically creating interfaces.
__________________
Gravita - a gravity simulation.
Available for Mac at http://www.thebluekoala.com
Duke Leto is offline   0 Reply With Quote
Old Jun 24, 2009, 08:20 PM   #2
kainjow
Demi-God (Moderator emeritus)
 
kainjow's Avatar
 
Join Date: Jun 2000
How are you initializing the window controller in code? Are you passing it the correct nib name? Oh, and don't call loadWindow (see the docs). You just need to init the controller with the right nib name, and call showWindow:
kainjow is offline   0 Reply With Quote
Old Jun 24, 2009, 08:24 PM   #3
Duke Leto
Thread Starter
macrumors regular
 
Join Date: Mar 2008
Ooh... you mean to say that Cocoa doesn't magically initialize things after all?

I should have known that Keebler elves weren't magically fixing my code!

Thanks!
__________________
Gravita - a gravity simulation.
Available for Mac at http://www.thebluekoala.com
Duke Leto is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
"Create a Windows 7 install disk" winks360 Windows, Linux & others on the Mac 19 Aug 22, 2012 03:47 PM
Lion not remembering open Finder Windows? gumbyx84 Mac OS X 10.7 Lion 1 Aug 14, 2011 05:21 PM
Open Duplicate Window (xcode) Ipodize Mac Programming 3 May 16, 2011 09:47 PM
For some reason when i open dictionary it opens multiple windows DAAAAAAAVE Mac Applications and Mac App Store 9 Oct 5, 2009 09:23 AM
Clicking safari dock open to open new window? toxicquack Mac Applications and Mac App Store 9 Aug 3, 2009 02:39 AM


All times are GMT -5. The time now is 04:02 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC