Embedding a system preference pane
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