Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subclassing WebView



I'm trying to subclass WebView in order to override and handle keypress events -- and not getting very far; I can't even get a request taken care of.

I have a program that is working fine with a stock WebView class object. I can call the loadRequest: method on this WebView object and it loads the specified URL, e.g.:

[[targetDisplayWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[targetURL stringValue]]]];

However, I cannot seem to get a subclassed WebView (custom) object to do the same thing. The request does not appear to go through.

I have connected my Controller's webview outlet to the custom view object, which is an instance of CustomView sitting within an NSWindow. I have adjusted my Controller header file to reflect the naming change. All the other calls to this instantiation of my WebView subclass have the same name.

Unfortunately the loadRequest: method does not load the requested URL. I just get a blank page.

Are there base methods I need to declare within my WebView subclass, or delegates which I first need to connect to my Controller?

The documentation for WebView here:

http://developer.apple.com/documentation/Cocoa/Reference/WebKit/ Classes/WebView_Class/Reference/Reference.html

suggests the delegates are optional. There is no mention of what methods are required to be declared in a subclass.

I tried looking here for instructions on subclassing WebView, but no luck:

http://www.cocoadev.com/index.pl?WebKit

Is there anything special I need to do to subclass WebView?

Thanks in advance for any advice!

Thanks,
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.