0
本周我开始学习ios编码,但我得到一个奇怪的错误 我做了一个小脚本女巫有主页上的名称列表与UITableView
和当有人选择一行它打开相对的网址,但是当加载网页出现问题时 网页的行像'UITableView'。ios 5 UIWebView显示来自UITableView的行
你知道它为什么会产生这种错误吗?
这就是它生成的;
UPDATE 我已经重新所著我的应用程序,但proble仍然存在,我不明白为什么在rootviewcontroller.mi在网页
秀行调用网页类
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSDictionary *Game = [[self.Sections valueForKey:[[[self.Sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
[tableView deselectRowAtIndexPath:indexPath animated:YES]; //svanisce il blu
NSLog(@"%@", [[self.Games objectAtIndex:indexPath.row ] objectForKey:@"Url"]); // funge
WebPage *newWeb = [[WebPage alloc] init];
newWeb.theUrl = [NSURL URLWithString:[Game objectForKey:@"Url"]];
[self.navigationController pushViewController:newWeb animated:YES];
}
是WebPage.h
#import <UIKit/UIKit.h>
@interface WebPage : UITableViewController <UIWebViewDelegate> {
UIWebView *webView;
NSURL *theUrl;
}
@property (nonatomic, retain) NSURL *theUrl;
@property (nonatomic, retain) UIWebView *webView;
@end
,这是WebPage.m
#import "WebPage.h"
@implementation WebPage
@synthesize theUrl;
@synthesize webView;
- (void)viewDidLoad
{
[super viewDidLoad];
webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0, self.view.bounds.size.width, self.view.bounds.size.height)];
webView.delegate = self;
webView.scalesPageToFit = YES;
[webView loadRequest:[NSURLRequest requestWithURL:theUrl]];
[self.view addSubview:webView];
}
@end
显示你'didSelectRowAtIndexPath'方法,你如何启动web视图。 – 2012-03-09 20:56:46
是的,请更新您的代码,以便我们可以提出修订建议。 – 2012-03-09 21:14:20
而'web'是什么类?对于tableview,你有没有设置特殊的绘图选项? – 2012-03-10 17:39:23