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:
Comments
Post a Comment