diff --git a/contrib/mobile/iOS/Onelab/Parameter.mm b/contrib/mobile/iOS/Onelab/Parameter.mm index 3d5ce96f2cbbe790476192deae0ff7916fab101a..b107db0180602897df8e16fe5dcb8ce99ea03216 100644 --- a/contrib/mobile/iOS/Onelab/Parameter.mm +++ b/contrib/mobile/iOS/Onelab/Parameter.mm @@ -144,7 +144,6 @@ { std::vector<onelab::number> numbers; onelab::server::instance()->get(numbers,[name UTF8String]); - onelab::number number = numbers[0]; if(numbers.size() < 1) return; UIAlertController *alertController; UIAlertAction *destroyAction; @@ -156,9 +155,9 @@ style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { std::cout << numbers[0].getValueLabel(i).c_str() << std::endl; - //FIXME number.setValue(i); - onelab::server::instance()->set(numbers[0]); - [button setTitle:[NSString stringWithFormat:@"%s", numbers[0].getValueLabel(numbers[0].getValue()).c_str()] forState:UIControlStateNormal]; + [self updateNumber:numbers[0] withValue:i]; + + [button setTitle:[NSString stringWithFormat:@"%s", numbers[0].getValueLabel(i).c_str()] forState:UIControlStateNormal]; }]]; destroyAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDestructive @@ -175,6 +174,12 @@ [[Utils traverseResponderChainForUIViewController:button] presentViewController:alertController animated:YES completion:nil]; // FIXME traverseResponderChainForUIViewController is a goo idea ?? } +-(void) updateNumber: (onelab::number)n withValue:(double)v +{ + n.setValue(v); + onelab::server::instance()->set(n); +} + -(void)refresh { std::vector<onelab::number> number;