Ios 获取sharedApplication';在我的apple watch应用程序中不可用

Ios 获取sharedApplication';在我的apple watch应用程序中不可用,ios,objective-c,iphone,Ios,Objective C,Iphone,您好,我正在为apple watch开发一个应用程序,我的应用程序有一个按钮,我希望在配对的iPhone上单击该按钮打开safari。我是iOS开发的新手,以下是我迄今为止拥有的: 接口控制器 // // InterfaceController.h // ToolBelt WatchKit Extension // // Created by Chris on 3/12/15. // Copyright (c) 2015 Chris. All rights reserved. // #

您好,我正在为apple watch开发一个应用程序,我的应用程序有一个按钮,我希望在配对的iPhone上单击该按钮打开safari。我是iOS开发的新手,以下是我迄今为止拥有的:

接口控制器

//
//  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 
它给我的错误是:

ToolBelt WatchKit Extension/InterfaceController.m:22:21: 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.
任何帮助都将是惊人的抱歉问这样一个新手问题


提前感谢

如错误消息所示,UIApplication类无法从扩展(包括WatchKit扩展)获得。无法从WatchKit扩展在用户手机上打开URL。你应该考虑采用切换来给用户一个快速的方法从你的手表应用程序转换到你的手机应用程序。
ToolBelt WatchKit Extension/InterfaceController.m:22:21: 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.