I’m trying to load a local HTML file from my supporting files folder in my project… I keep getting this message… Thread 1: breakpoint 1.1 and I don’t know why, my code for the web view is below
#import "WPViewController.h"
@interface UIViewController ()
@end
@implementation WPViewController
@synthesize viewWeb;
- (void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"localHTML"];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[viewWeb loadRequest:request];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (IBAction)dismissView:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
@end
Header…
#import <UIKit/UIKit.h>
@interface WPViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *viewWeb;
- (IBAction)dismissView:(id)sender;
@end
First, double check you haven’t set any breakpoints that are stopping your app. You can disable/enable them using CMD+Y. Also, you can see if you have set any at all on the left pane -> Breakpoint Navigator tab.
Also, you should try to implement the UIWebViewDelegate protocol and override
in your WPViewController so you can obtain some more info on why the page isn’t being displayed.