开发者

How can i use circular Progress indicator in my cocoa programming?

开发者 https://www.devze.com 2023-01-11 03:14 出处:网络
this is my code and i want use this object to show loading progress,what should i do? // view.h #import <Cocoa/Cocoa.h>

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消