Plugin Properties
If you are creating a page or pagelet plug-in, it's pretty much a given that you'll need to persistently store the properties that make up the plug-in. e.g. The user's choice of layout or a URL.
To support this, all relevant Sandvox classes inherit from KSExtensibleManagedObject, allowing you to use the standard -valueForKey: and -setValue:forKey: methods to store your own data. KSExtensibleManagedObject is very flexible, supporting the use of:
- Any object conforming to the
NSCodingprotocol. KTPageobjects.KTMediaContainerobjects.
KSExtensibleManagedObject even has full KVO-compliant undo/redo support for your data, just like a standard Core Data managed object.
Some examples:
[[self delegateOwner] setValue:@"foo" forKey:@"bar"]; [[self delegateOwner] setValue:[mediaManager mediaContainerWithPath:aPath] forKey:@"media"] [aPage valueForKey:@"bar"]
