I’m trying to make an app in xcode for my iphone to control my ip camera so I’ve setupa controller with a webview which loads a html link to my ip cam. I’ve also setup some IBActions linked to some buttons trying to control the camera movements when pressing the buttons (right, left up, down).
Each IBAction linked to the buttons looks like
-(IBAction)camMoveUp
{
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"http://192.168.1.2/decoder_control.cgicommand=0&user=myusername&pwd=mypassword"]]
}
This action, when sent to the internet/router triggers my camera to move up.
It works but everytime I hit a button it redirects to safari and displays a message “ok” on the screen. The camera moves where was directed to, BUT HOW CAN I IMPLEMENT THIS WITHOUT BEING REDIRECTED TO SAFARI EVERY SINGLE TIME I PRESS A BUTTON?
Please help.
Or Else you can Take a webView inside your View and open the URL
If you want to do some activity after page loads then you can use webview delegate functions.
check here is a complete tutorial For WebView.