Reputation: 262
I have a UIWebView that I want to make visible after a link is loaded. It is hidden and everything works until it needs to be shown. I am positive I can make the UIWebView visible again because I have placed it after I called the URL. I am positive that the webViewDidFinishLoading
method is not being called when the UIWebView is indeed finished loading, nor will it log what is in that method as well. What could be causing this problem? Thanks. Here is my code:
The .m file:
@interface KnoxGradesViewController : UIViewController <UIWebViewDelegate> {
IBOutlet UIWebView *webView;
IBOutlet UIButton *log;
IBOutlet UISwitch *rem;
IBOutlet UIActivityIndicatorView *stat;
}
@property (nonatomic, retain) IBOutlet UIButton *about;
@property (nonatomic, retain) IBOutlet UITextField *username;
@property (nonatomic, retain) IBOutlet UITextField *password;
@property (nonatomic, retain) IBOutlet UIButton *login;
@property (nonatomic, retain) IBOutlet UILabel *warning;
@property (nonatomic, retain) IBOutlet UIWebView *webView;
@property (nonatomic, retain) IBOutlet UIButton *log;
-(IBAction)showAbout;
-(IBAction)checkFields;
-(IBAction)logOut;
The .h file:
- (void)webViewDidFinishLoad:(UIWebView *)mwebView {
NSLog(@"Got here!");
[mwebView setHidden:false];
}
Upvotes: 4
Views: 2711
Reputation: 471
i think you are missing the delegate assignment as well. What Mike explained is correct, you can right click the webview in the Objects Panel within interface builder and link the delegate to the File's Owner.
OR you could try doing it through code
in your viewDidLoad you could add
[webView setDelegate:self];
Upvotes: 10