Skip to content
Snippets Groups Projects
Commit c8e50026 authored by Maxime Graulich's avatar Maxime Graulich
Browse files

iOS: fix selectValue (update onelab)

parent 38459c9f
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment