I'm currently trying to dynamically change the UILabel pageTitle to match the title of the page being displayed on a UIWebView. Despite not encountering any warnings or errors, the label text remains unchanged.
ViewController.h
@interface ViewController : UIViewController <UITextFieldDelegate, UIWebViewDelegate, UIActionSheetDelegate> {
UIWebView *_webView;
UILabel *_pageTitle;
}
@property (nonatomic, retain) IBOutlet UIWebView *webView;
@property (nonatomic, retain) IBOutlet UILabel *pageTitle;
@end
ViewController.m
- (void)webViewDidFinishLoad:(UIWebView *)webView {
self.pageTitle.text = [_webView stringByEvaluatingJavaScriptFromString:@"document.title"];
[_webView setDelegate:self];
}
Screenshot of IB