This is an old post but maybe someone is still looking for a solution. I found that you can just override the fullStateForDocument property and just archive your settings using a Dictionary. No need to play with parameter trees if you don't need your settings to be modified by the Host.
// Save an NSString named setting.
- (NSDictionary<NSString *,id> *)fullStateForDocument {
NSMutableDictionary *state = [[NSMutableDictionary alloc] initWithDictionary: super.fullStateForDocument];
NSDictionary<NSString*, id> *settingsToSave = @{@"setting": setting,};
state[@"savedSettings"] = [NSKeyedArchiver archivedDataWithRootObject:settingsToSave requiringSecureCoding:NO error:nil];
return state;
}
// Retrieve settings
- (void)setFullStateForDocument:(NSDictionary<NSString *,id> *)fullStateForDocument {
NSData *data = (NSData *)fullStateForDocument[@"savedSettings"];
NSDictionary *savedSettings = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSDictionary class] fromData:data error:nil];
setting = (NSString *)savedSettings[@"setting"];
}