Reputation: 2543
is it possible to execute:
[UIWebView loadRequest:[NSURLRequest requestWithURL:url]];
in a way that I know when UIWebView is finished loading the NSURL so I can proceed with further processing ? Other than using a delegate. If not what are the conditions under which the delegate will work.
Thank you for any tips/ideas
To explain further. I have this code that worked for me in a test application:
webview = [[UIWebView alloc] init];
webview.delegate = self;
[webview loadRequest:[NSURLRequest requestWithURL:url]];
In the test app's header I had:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UIWebViewDelegate> {
UIWebView *webview;
}
I'm trying to replicate this in a very complex environment that I don't fully understand. I don't know where to put since it's not clear to me. The interface is defined as:
@interface Stream (Extension)
@end
and it has four more interface defined later in the header file.
In my implementation I get "undeclared identifier self"
Upvotes: 1
Views: 1209
Reputation: 37581
You could find out when the web view has finished fetching the content of the NSURL and any embedded content requests in the page if you used an NSURLProtocol to intercept the network traffic (but you would have to know in advance if the html page is going to make requests to fetch i.e. images).
But you cannot detect when the UIWebView has loaded the dom or finished displaying the page without the delegate (out of curiosity may I know why you are asking such a question).
Upvotes: 1