解决超链接添加 target="_blank"之后在WebView中不能打开

来源:互联网 发布:c语言不等于0怎么表示 编辑:程序博客网 时间:2024/05/22 14:12

小竹小站:www.chinadev.cn

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification{    [webViewsetUIDelegate:self];}- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request{    NSLog(@"sss%@",sender);    NSUInteger windowStyleMask =    NSClosableWindowMask |     NSMiniaturizableWindowMask |    NSResizableWindowMask |    NSTitledWindowMask;    NSWindow * webWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) styleMask:windowStyleMask backing:NSBackingStoreBuffereddefer:NO];    WebView * newWebView = [[WebView alloc] initWithFrame:[webWindow contentRectForFrameRect:webWindow.frame]];    [newWebView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];    [webWindow setContentView:newWebView];    [webWindow center];    [webWindow makeKeyAndOrderFront:self];    [[newWebView mainFrame] loadRequest:request];    return newWebView;}



 

原创粉丝点击