• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Embedding a system preference pane
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Embedding a system preference pane


  • Subject: Embedding a system preference pane
  • From: Jon Guy <email@hidden>
  • Date: Fri, 20 Aug 2010 09:44:26 +0100

Hi
I'm trying to embed a couple of the system pref panes into an app by following the Apple documented method, here's basically whats going on:

NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PreferencePanes/SharingPref.prefPane"];
Class principalClass = [bundle principalClass];
prefPane = [[principalClass alloc] initWithBundle:bundle];
[prefPane loadMainView];
[prefPane willSelect];
prefView = [prefPane mainView];
[[[self window] contentView] addSubview:prefView];
[[self window] makeKeyAndOrderFront:self];
[prefPane didSelect];

This works fine for one of the other panes. I then tried it for the Sharing pref pane but it only seems to be half working. The Pane appears and I can see the computer name and the table with the list of services but only the DVD Sharing service is working (somewhat). None of the other services are reflecting the state of that service and they are always greyed out. Also when you select a service it's corresponding settings view does not appear on the right side of the table (I hope this is making sense). This is not something hacky, it is documented by Apple and is supposed to work but it's clearly not or I'm doing something wrong. Any help would be appreciated.
Thanks
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Embedding a system preference pane
      • From: Knut Lorenzen <email@hidden>
    • Re: Embedding a system preference pane
      • From: Bill Bumgarner <email@hidden>
    • Re: Embedding a system preference pane
      • From: Mark Ritchie <email@hidden>
  • Prev by Date: Re: NSImageView and ZoomFactors
  • Next by Date: Re: Embedding a system preference pane
  • Previous by thread: Re: Statically link libmysqlclient.a to my Foundation tool
  • Next by thread: Re: Embedding a system preference pane
  • Index(es):
    • Date
    • Thread