I have created custom class and files are showBlock.h and showBlock.m for loading UIWebView programmatically the implementation for showBlock.m is
#import "showBlock.h"
@implementation showBlock;
@synthesize mainViewContObj;
- (void) showView {
UIWebView *aWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
aWebView.autoresizesSubviews = YES;
aWebView.autoresizingMask = (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
[aWebView setDelegate:[self mainViewContObj]];
NSString *urlAddress = @"http://localhost/test/index.php";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[aWebView loadRequest:requestObj];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
[[[self mainViewContObj] view] addSubview:aWebView];
}
@end
it is working fine, and loading index.php file with html content but I would like to open links of this html file in safari browser, what things I need to do for that?
You need to add the delegate method implementation below in ShowBlock.m