我必须第二次重新加载 mainviewcontroller webview 并重新加载 webview。
应用程序:
- (void) webViewDidFinishLoad:(UIWebView*) theWebView
{
// only valid if FooBar.plist specifies a protocol to handle
if (self.invokeString)
{
// this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}else {
if([loginComplete isEqualToString:@"1"] ){
NSString *page = @"intro.html";
NSString* jsString = [NSString stringWithFormat:@"loadParams('%@','%@','%@');", at,userfbid,page];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}
else {
NSString *page = @"friends.html";
NSString* jsString = [NSString stringWithFormat:@"loadParams('%@','%@','%@');", at,userfbid,page];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}
// Black base color for background matches the native apps
theWebView.backgroundColor = [UIColor grayColor];
return [self.viewController webViewDidFinishLoad:theWebView];
}
-(void)insert{
self.viewcontroller.webview.delegate=self;
}
Webdelegate 未在插入中触发。
谢谢