我已经尝试了所有推荐的方法,SOF
但仍然无法解决我的问题。
这是在我的UITableView didSelectRowAtIndexPath
if ([[[AryStoreknowItem objectAtIndex:indexPath.row] objectForKey:@"action"] isEqualToString:@"a9"]||[[[AryStoreknowItem2 objectAtIndex:indexPath.row] objectForKey:@"action"] isEqualToString:@"a9"]){
NSString *a9 = [[AryStoreknowItem objectAtIndex:indexPath.row] objectForKey:@"content"];
NSLog(@" url from XML; %@ ",a9);
webView *web=[[webView alloc]init];
[web viewDidLoad];//go to webView page
当我选择这一行时,它会从 XML 中检测 URL 并打开UIWebView
但它不起作用。显示它检测到NSLog
这些网址;http://www.google.com
网页浏览页面;
#import "webView.h"
#import "inboxData.h"
@interface webView ()
@end
@implementation webView
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *a9 = [defaults objectForKey:@"a9"];
NSLog(@"URL from inboxData get from XML detect >>> %@",a9);
NSURL *url = [NSURL URLWithString:a9];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:requestObj];
}
谁能给任何想法如何解决这个问题?