Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BadWolf13

macrumors 6502
Original poster
Dec 17, 2009
271
0
I'm reading up on Modal windows, and based on the documentation, it seems like the only way to use runModalForWindow: is if the window I want to run as a modal is included in the XIB file for the main application. Am I correct in this, or can I store that window in a separate XIB file and call it with that method?
 
You can store the window anywhere. Generally though, you should have one window per nib, so you're not loading resources unnecessarily. NSWindowController makes this easy.
 
That's what I was thinking, since this "modal" window won't be used in every instance, I don't want to use unnecessary resources. If said window was in a separate XIB file but had a window controller called myWindowController, could I use a code like;

Code:
runModalForWindow:[myWindowController window]

Would that work?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.