views:

86

answers:

1

this is my code and i want use this object to show loading progress,what should i do?

// view.h

#import <Cocoa/Cocoa.h>
#import<WebKit/WebKit.h>

 @interface view : NSObject {
  IBOutlet WebView* webview;
  }
 -(IBAction) google:(id) sender;

 @end

//view.m

 #import "view.h"

@implementation view
  -(IBAction) google:(id) sender
  {
   [[webview mainFrame] loadRequest:
   [NSURLRequest requestWithURL:
   [NSURL   URLWithString:@"http://www.google.com/finance/converter"]]];
   }

  @end
A: 

Look at WebResourceLoadDelegate. Also, from WebView class reference page:

Another way to monitor load progress with less control is to observe the WebViewProgressEstimateChangedNotification, WebViewProgressFinishedNotification, and WebViewProgressStartedNotification notifications. For example, you could observe these notifications to implement a simple progress indicator in your application. You update the progress indicator by invoking the estimatedProgress method to get an estimate of the amount of content that is currently loaded.

Merrimack
my programming is cocoa not cocoa touch .i think UIWebViewDelegate dosen't exist.
aden
Sorry, my bad. Updated the answer accordingly
Merrimack