• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
subclassing WebView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subclassing WebView


  • Subject: subclassing WebView
  • From: Alex Reynolds <email@hidden>
  • Date: Fri, 13 Oct 2006 12:22:00 -0400

I'm trying to subclass WebView in order to override and handle keypress events and not getting very far.

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.h header file to reflect the naming change. All the other calls to this WebView subclass are the same.

Unfortunately the loadRequest: method does not load the requested URL.

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.

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.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSTableView with NSArray and C-array question
  • Next by Date: Re: Where to find free EULA Templates?
  • Previous by thread: Table column width not integer, fuzzy headers
  • Next by thread: Tracking frontmost App
  • Index(es):
    • Date
    • Thread