hello I am working a a app for apple watch and my app has a button and i want when the button is clicked to open safari on the paired iPhone i'm new to iOS development so heres what i have so far:
InterfaceController.h
//
// InterfaceController.h
// ToolBelt WatchKit Extension
//
// Created by Chris on 3/12/15.
// Copyright (c) 2015 Chris. All rights reserved.
//
#import <WatchKit/WatchKit.h>
#import <Foundation/Foundation.h>
@interface InterfaceController : WKInterfaceController
-(IBAction) internetbttn;
@end
@interface ViewController : UIViewController< UIWebViewDelegate >
@end
InterfaceController.m
#import "InterfaceController.h"
@interface InterfaceController()
@end
@implementation InterfaceController
-(IBAction) internetbttn: (id)sender {
NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
[[UIApplication sharedApplication] openURL:url];
}
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
}
- (void)willActivate {
// This method is called when watch view controller is about to be visible to user
[super willActivate];
}
- (void)didDeactivate {
// This method is called when watch view controller is no longer visible
[super didDeactivate];
}
@end
the error its giving me is this:
ToolBelt WatchKit Extension/InterfaceController.m:22:21: 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.
any help would be amazing sorry for asking such a rookie question
Thanks in advance