• 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
Key path for values in "Shared User Defaults"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Key path for values in "Shared User Defaults"?


  • Subject: Key path for values in "Shared User Defaults"?
  • From: Matthias Arndt <email@hidden>
  • Date: Mon, 23 Mar 2009 20:54:00 +0100

Please help me: What is the key path of a value stored in the shared user defaults?

I'm using a sub-classed NSViewController to enhance the print panel with an accessory view:

NSBundle *appBundle = [NSBundle bundleForClass:[self class]];
NSViewController *accessoryViewController = [[PrintOptions alloc] initWithNibName:@"PrintOptions" bundle:appBundle];
[[printOperation printPanel] addAccessoryController:accessoryViewController];


The view "PrintOptions" includes three checkboxes, all bind to the Shared User Defaults Controller. The printed view uses these values to modify its output. Everything works fine except the preview in the print panel: It isn't updated when I check / uncheck any of the boxes, although the view controller conforms to the "NSPrintPanelAccessorizing" protocol and should use KVO to be notified for changes.

I think my "keyPathsForValuesAffectingPreview" implementation is wrong as I don't know how to reference a shared user default:

- (NSSet *)keyPathsForValuesAffectingPreview
{
return [NSSet setWithObjects: @"PrintFastMode", @"PrintJumps", @"PrintGrid", nil];
}

The documentation I found only mentioned an example with document margins, but what is the key path for properties bind to the user defaults? Sorry, I'm totally lost ...


Mattes
_______________________________________________


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: Key path for values in "Shared User Defaults"?
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: MacRoman -> UTF8 [solved]
  • Next by Date: Re: NSLevelIndicator Bindings Crash
  • Previous by thread: Re: OpenGL Prog Guide for OSX - override initWithFrame
  • Next by thread: Re: Key path for values in "Shared User Defaults"?
  • Index(es):
    • Date
    • Thread