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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -