views:

110

answers:

1

I am having trouble displaying a webview. I have a webview inside a custom view. I load this custom view as a subview of the window, and then have an object controller linking a text field to the content of the web view. Once a page is loaded, it loads all the content, but it is visually white. You can click on links. If you go to a Youtube video you can listen to it, but it still displays nothing. To load the custom view I run:

PageViewController *page = [[PageViewController alloc] initWithNibName:@"PageView" bundle:nil];
[page loadView];
[view addSubview:[page view]];

Then to load the page I have the following:

-(IBAction)connectURL:(id)sender
{
    NSLog(@"connecting");
    [webView setMainFrameURL:[sender stringValue]];
}

Where connectURL is bound to a text field.

+1  A: 

Have you set your custom view to be layer-backed? You can't use a WebView in a layer-backed view. If that's not the problem, can you post your custom view's drawing code?

Rob Keniger
The scroll view in the main window was layer backed.
Scott Dugas