从handleWatchKitExtensionRequest打开ViewController

时间:2015-08-25 16:12:56

标签: ios objective-c appdelegate

我遇到了这样一个问题,我无法打开handleWatchKitExtensionRequest的NewsDetailVievController。

-(void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply {

NSString *counterValue = [userInfo objectForKey:@"id"];
NSLog(@"MY ANSWER %@", counterValue);
NSDictionary *replyDict = @{@"response": counterValue};

reply(replyDict);

NSNumberFormatter *f = [[NSNumberFormatter alloc] init];
f.numberStyle = NSNumberFormatterDecimalStyle;
NSNumber *myNumber = [f numberFromString:counterValue];
NewsDetailViewController *ndvc = [[NewsDetailViewController alloc] init];

ndvc.objectId = myNumber;
[(UINavigationController *)self.window.rootViewController pushViewController:ndvc animated:NO];
}

在本文中,我为给定的objectId加载控制器并插入到WebView中,当我调用控制器时,可以看到装载纸张的空白区域。并且感觉WebView无法启动。

0 个答案:

没有答案