Settings

Settings

The ‘Settings’ scene is responsible for Setting Options management. The main UI scene contains a show segue to the ‘Settings’ scene in the ‘Settings’ button of the main UI scene. It divides into two parts: Get Settings for getting options and Set Settings for setting options.

 

ios_settings_scene.png

 

In the Get Settings part, each option has a switch next to the option name field. Turn on the options to retrieve option values and click the ‘Get’ button to execute the /settings/get API. The result is shown in a dialog. 

 

- (IBAction)clickGetSettingsButton:(id)sender {
    NSLog(@"click------ get button");
    [FriendsCameraSettings OSCRequestSettingGet:_arrayGetSettings
		 block_notConnected:^{} 
		 block_errorHTTP:^(id errMsg){} 
		 block_errorOSC:^(id errMsg){} 
		 block_finally:^{} block_success:^(NSData *result){
			 NSDictionary *resultDictionary = 
			 [Utils convertJSONDataToDictionary:result];
			 NSString* resultString = 
			 [Utils convertDictionaryToPrettyString:resultDictionary];
			 
			 NSLog(@"result ----- ,%@", resultString );
			 [Utils alertWithTarget:self title:@"Response" 
			 message:resultString buttonOK:@"OK" buttonOKHandler:nil];
		 }];
}

 

In the Set Settings part, set values to the options and click the ‘Set’ button to execute the /settings/set API. The result is shown in a dialog.

 

- (IBAction)clickSetSettingsButton:(id)sender {
    ...
    
    [FriendsCameraSettings OSCRequestSettingSet:arrRequest
	 block_notConnected:^{}
	 block_errorHTTP:^(id errMsg){} 
	 block_errorOSC:^(id errMsg){} 
	 block_finally:^{} 
	 block_success:^(NSData *result){
		 NSDictionary *resultDictionary = [Utils convertJSONDataToDictionary:result];
		 NSString* resultString = [Utils convertDictionaryToPrettyString:resultDictionary];
		 
		 NSLog(@"result ----- ,%@", resultString );
		 [Utils alertWithTarget:self title:@"Response" message:resultString buttonOK:@"OK" buttonOKHandler:nil];
	 }];
}
Navigation