views:

37

answers:

0

Hello, Good day ! : D My first app close to final. But, I can't go next. Help !! T _T

I Want >>>>> If first list( at firstview) click, Sub view load "http://google.com>" and then back to firt View, second list( at first view) click sub view load "http://yahoo.com>" But Now >>>> If first list click, sub view load "http://google.com>". and then back to list, second list click, sub view load "http://google.com>".

Subview not reset T_T

Here is my source.

RootViewController.m (first view)

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  if(bdvController == nil)

  bdvController = [[WebView alloc] initWithNibName:@"WEbView" bundle:[NSBundle mainBundle]];

  AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row];

  bdvController.appRecord = appRecord;

  [self.navigationController presentModalViewController:bdvController animated:YES];
 }

WebView.h (subview)

#import <UIKit/UIKit.h>

@class AppRecord;
@interface WebView : UIViewController {

     IBOutlet UIWebView *web;
     IBOutlet UINavigationBar *navi;
     AppRecord *appRecord;

    }

@property (nonatomic, retain) AppRecord *appRecord;
- (IBAction)dismissAction:(id)sender;
@end

WebView.m (subview)

#import "WebView.h"
#import "AppRecord.h"

@implementation WebView
@synthesize appRecord;

-(void)viewDidLoad
 {

     [super viewDidLoad];

     NSLog(@"url: %@", appRecord.appLink);
     NSURL *url = [[NSURL alloc] initWithString:appRecord.appLink];
     [web loadRequest:[NSURLRequest requestWithURL:url]];

     [self dismissModalViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

}



- (void)viewDidUnload {

    [super viewDidUnload];
}



- (void)dealloc {
     [appRecord release];
     [web release];
        [super dealloc];
}


- (IBAction)dismissAction:(id)sender

{
     [self.parentViewController dismissModalViewControllerAnimated:YES];
}


@end