I have an IB that contant an UIWebView
#import <UIKit/UIKit.h>
@interface PostFunHorosViewController : UIViewController<UIWebViewDelegate>{
}
@property (nonatomic, retain) IBOutlet UIWebView *description;
@end
And at ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
description.delegate = self;
[self.description loadHTMLString:[NSString stringWithFormat:@"<div align='justify'>%@<div>",[@"This is test string" stringByReplacingOccurrencesOfString: @"\n" withString:@"<br/>"]] baseURL:nil];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSLog(@"webViewDidFinishLoad");
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
NSLog(@"webViewDidStartLoad");
}
And this is how I add IB to my screen:
- (void)viewDidLoad
{
PostFunHorosViewController *postVC = [[PostFunHorosViewController alloc] initWithNibName:@"PostFunHorosViewController" bundle:nil];
[scroller addSubview:postVC.view];
[postVC release];
[super viewDidLoad];
}
My problem is it never call webViewDidFinishLoad and webViewDidStartLoad.
Moreover it also stuck in
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([IHOROSAppDelegate class]));
}
}
with no exception.
Am I miss something. Please help me. Thank in advance.
Use –
earlier you are doing –
while you haven’t define instance variable, instead you have defined property.