Hey,
I'm following this website and trying to get the code working in my app: http://fei263.blog.163.com/blog/static/92793724200952684731442/
(I downloaded the headers from the above site, added them into my project and have imported them in my .m file)
This is my code:
I am able to run the code, but I never see any log notifications. I wasn't able to do add the frameworks requested (WebKit.framework and WebCore.framework) as I couldn't find them however I don't receive any compiler errors, only one repeated warning which doesn't seem relevant, but here it is nonetheless:
I'm following this website and trying to get the code working in my app: http://fei263.blog.163.com/blog/static/92793724200952684731442/
(I downloaded the headers from the above site, added them into my project and have imported them in my .m file)
This is my code:
Code:
- (void)viewDidLoad {
[super viewDidLoad];
test = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
test.scalesPageToFit = YES;
test.delegate = self;
[self.view addSubview:test];
WebView *coreWebView = [[test _documentView] webView];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(progressEstimateChanged:) name:@"WebViewProgressEstimateChangedNotification" object:coreWebView];
NSURL *url = [NSURL URLWithString:@"http://www.apple.com"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[test loadRequest:urlRequest];
}
Code:
- (void)progressEstimateChanged:(NSNotification*)theNotification {
NSLog(@"The progress: %@", [[theNotification object] estimatedProgress]);
if ((int)[[theNotification object] estimatedProgress] == 1) {
NSLog(@"The progress is finished");
}
}
I am able to run the code, but I never see any log notifications. I wasn't able to do add the frameworks requested (WebKit.framework and WebCore.framework) as I couldn't find them however I don't receive any compiler errors, only one repeated warning which doesn't seem relevant, but here it is nonetheless:
Declaration of 'struct __GSEvent' will not be visible outside of this function