Iphone 将TableView Url推送到webView

Iphone 将TableView Url推送到webView,iphone,objective-c,uitableview,Iphone,Objective C,Uitableview,我的表格有问题,在嵌入到我的项目之前,我使用了苹果公司的LazyTableImages示例。 当像这样加载我的xml时,一切都很好 <im:title>1</im:title> <content type="html">some desc</content> <im:releaseDate label="October 23, 2013">2013-10-23T00:00:00-07:00</im:releaseDate>

我的表格有问题,在嵌入到我的项目之前,我使用了苹果公司的LazyTableImages示例。 当像这样加载我的xml时,一切都很好

<im:title>1</im:title>
<content type="html">some desc</content>
<im:releaseDate label="October 23, 2013">2013-10-23T00:00:00-07:00</im:releaseDate>
<im:artist href="http:/facebook.com">Facebook</im:artist>               
<im:name>1</im:name>
<im:image height="53">http://chingfong.com/Icon.png</im:image>
<url>http://facebook.com/url>
<im:date>Ene, 27 2013</im:date>
h-i还添加了

static NSString *kUrlStr    = @"url";


 - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
                                          namespaceURI:(NSString *)namespaceURI
                                         qualifiedName:(NSString *)qName
    {
        if (self.workingEntry)
        {
            if (self.storingCharacterData)
            {
                NSString *trimmedString = [self.workingPropertyString stringByTrimmingCharactersInSet:
                                           [NSCharacterSet whitespaceAndNewlineCharacterSet]];
                [self.workingPropertyString setString:@""];  // clear the string for next time
                if ([elementName isEqualToString:kIDStr])
                {
                    self.workingEntry.appURLString = trimmedString;
                }
                else if ([elementName isEqualToString:kNameStr])
                {        
                    self.workingEntry.appName = trimmedString;
                }
                else if ([elementName isEqualToString:kImageStr])
                {
                    self.workingEntry.imageURLString = trimmedString;
                }
                else if ([elementName isEqualToString:kUrlStr])
                {
                    self.workingEntry.appURL = trimmedString;
                }
                else if ([elementName isEqualToString:kArtistStr])
                {
                    self.workingEntry.artist = trimmedString;
                }
            }
            else if ([elementName isEqualToString:kEntryStr])
            {
                [self.workingArray addObject:self.workingEntry];  
                self.workingEntry = nil;
            }
        }

    }
tableView中的RootViewController.m选择了RowAtIndexPath

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row];
    NSString *urlAddress = appRecord.appURL;
    NSURL *url = [NSURL URLWithString:urlAddress];
    WebViewController *detailViewController = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
//    WebViewController.sites= [_entries objectAtIndex:indexPath.row];
    [detailViewController.webView loadRequest:[NSURLRequest requestWithURL:url]];

    [self.navigationController pushViewController:detailViewController animated:YES];
}
WebViewController.h

@interface WebViewController : UIViewController <UIWebViewDelegate>
@property (nonatomic, strong) IBOutlet UIWebView *webView;
@界面WebViewController:UIViewController
@属性(非原子,强)ibuiwebview*webView;
表格加载良好,当我选择单元格时,它会推送到WebViewController,但UIWebView没有加载网页,它只是空白(白色)

有人能帮我修一下吗?
非常感谢

我认为最好的方法是将url从
RootViewController
传递到
WebViewController
并在
WebViewController
中刷新webview。 因此,您需要像这样修改代码:

tableView中的RootViewController.m选择了rowatinexpath

// Add a @property of your detail view for lazing
@property (nonatomic, strong) WebViewController *detailViewController;

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row];

    if (!_detailViewController)
        self.detailViewController = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil];

   self.detailViewController.websiteURL = appRecord.appURL;

    [self.navigationController pushViewController:self.detailViewController animated:YES];

}
@interface WebViewController : UIViewController <UIWebViewDelegate>
@property (nonatomic, strong) IBOutlet UIWebView *webView;
@property (nonatomic, strong) NSString *websiteURL;
WebViewController.h

// Add a @property of your detail view for lazing
@property (nonatomic, strong) WebViewController *detailViewController;

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row];

    if (!_detailViewController)
        self.detailViewController = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil];

   self.detailViewController.websiteURL = appRecord.appURL;

    [self.navigationController pushViewController:self.detailViewController animated:YES];

}
@interface WebViewController : UIViewController <UIWebViewDelegate>
@property (nonatomic, strong) IBOutlet UIWebView *webView;
@property (nonatomic, strong) NSString *websiteURL;