objective c - Open my Own Mac App Preferences -


i newbie in cocoa application.
want programmatically open application's preferences window

by googling, can found --> [[nsworkspace sharedworkspace] openfile:@"myapp.prefpane"];"

any appreciated.---

thanks.

you open preference window other within app:

in app delegate class:

- (ibaction)showpreferencepanel:(id)sender {     if (!_preferencecontroller)         _preferencecontroller = [[preferencecontroller alloc] init];      [_preferencecontroller showwindow:self]; } 

where preferencecontroller is:

@interface preferencecontroller : nswindowcontroller <nswindowdelegate, nstoolbardelegate, fontchooserviewdelegate> ... @end 

and in mainmenu.xib showpreferencepanel method hooked in this:

enter image description here


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -