Spire
Spire

Reputation: 1065

programaticly create a web view and a button to return to previous view

i would appreciate a concept on How can i create a web view and set a return button so the user can return on the previous view. I have a table view that goes to a detail view, and on the detail view i have a button that has a url link connected. Now when this button is selected it should open a web view (should it be another .xib file?) and on the web view i need a toolbar with return button that will return the detail view

i need idea on how can i do this

Thanks all

-edit i have the

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

        aBook = [delegate.books objectAtIndex:indexPath.row];   
        // Configure the cell.
        titleValue = aBook.title;
        authorValue = aBook.author;
        urlValue = aBook.bookUrl;

        detailViewController = [[DetailView alloc] initWithNibName:@"DetailView" bundle:nil];
        detailViewController.title = titleValue; 
        detailViewController.author = aBook.author;
        detailViewController.bookUrl = aBook.bookUrl;

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

    }

this sets values for the detail view, so should i have the same to send the url to the web view??

Upvotes: 0

Views: 465

Answers (1)

ipraba
ipraba

Reputation: 16553

One option is of-course you can create a new xib with your webviews and Toolbars in thirdViewController and pass the url to the viewController. by touching back button you can dismiss your thirdViewController and you have the detailViewController.

or

If you really dont want to have a viewController you can create your customView design and place the controls programmatically. Then add subview the customView to your detailView. Create delegates to handle the customView Actions so that remove your customview from your detailView when back button is touched.

let me know if you have doubts

Upvotes: 1

Related Questions