I have the code below? for a UISlider and a UISwitch control event, I build many of these buttons dynamically.
[buttonControl addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];
[sliderControl addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
When I press the button I want to call a function that calls a web page (specific/different for each button), the webpage will output a message that should be shown in a message box, if the message box is empty is should say there was an error and revert the control to its previous value.
so the function (this is psudeo code)? would be somthing like:
function callWebPage(currentValue, newValue, url)
{
? ? ? ? strMessage = downloadWebPage(url + "&status=" + newValue);
? ? ? ? if(strMessage=="")
? ? ? ? {
? ? ? ? ? ? ? ? msgbox("sorry there was an error")
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? ? ? msgbox = strMessage;
? ? ? ? }
}
This project is to complete the psudeo code so that the application behaves as described above.