Show modal window using *.nib file
I have prefs pane application, and need to show modal window using specific nib file.
I use method:
[NSBundle loadNibNamed:@"___NibName___" owner:self];
It’s all right, but window is not modal( I can get access to prefs pane window ).
What should i dot to make this window modal( user should not have acces to prefs pane window, until current window will not be closed ).
2 Solutions Collect From Internet About “Show modal window using *.nib file”
Easiest way to do and manage afterwards: create a new NSWindowController, set this class as File’s owner in your custom nib/xib, connect the window outlet to your window within the nib/xib, get the window reference by first creating an instance of your class and then using
NSWindow *window = instance.window;
Then run it modal with NSApplication’s
If you’re on
You have to have a separate View Controller to manage that nib file if you want to present it as modal. Once you have an instance of that view controller, present it with this:
aViewControllerClasss *sampleView= [[aViewControllerClasss alloc] initWithNibName:@"___yournibname___" bundle:nil]; //set any variables of the new view controller(such as delegate) here, before you present it. [self presentModalViewController:sampleView animated:YES]; [sampleView release];
- Swift: Nil is incompatible with return type String
- Importing an external library in xcode – C++
- Differentiating images in an asset catalog by their group
- Swift: Override object method
- How to open & view view .doc, .docx, .rtf, .ppt, .pptx, .xlsx, .xls file in iphone using UIWebview in Document directory?
- Figure out time by latitude/longitude?
- Swift – UITableView scroll event
- iOS 6 – can i return data when i unwind a segue?
- How to convert image into hexa decimal bytes array to send it to output stream in iOS sdk
- iOS7 hide status bar but not adjust top layout guide
- Get the EXPIRATION date of a Provisioning Profile at Run-time?
- Different cornerRadius for each corner Swift 3 – iOS
- Fetch All Audio & Video files in ios
- iPhone 5s SpriteKit drawing oddities
- iconv library on Mac OS X: strange behavior