我有一个包含 UIWebView 的 IB
#import <UIKit/UIKit.h>
@interface PostFunHorosViewController : UIViewController<UIWebViewDelegate>{
}
@property (nonatomic, retain) IBOutlet UIWebView *description;
@end
在 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");
}
这就是我将 IB 添加到屏幕的方式:
- (void)viewDidLoad
{
PostFunHorosViewController *postVC = [[PostFunHorosViewController alloc] initWithNibName:@"PostFunHorosViewController" bundle:nil];
[scroller addSubview:postVC.view];
[postVC release];
[super viewDidLoad];
}
我的问题是它从不调用 webViewDidFinishLoad 和 webViewDidStartLoad。
而且它还卡在
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([IHOROSAppDelegate class]));
}
}
无一例外。
我是不是想念什么了。请帮我。预先感谢。