Note that there are some explanatory texts on larger screens.

plurals
  1. POpushViewController or presentModalViewController to present something in the same screen
    primarykey
    data
    text
    <p>I have an iPad app that pulls info from an RSS feed, but instead of pushing to present information in the next screen, I want to still show it in the same screen (see image)</p> <p>When I use <strong>pushViewController</strong> NOTHING happens. When I use <strong>presentModalViewController</strong> the blue background changes to the webview. But what I want is when I click on a row from the feed on the left, the webview on the right gets the website.</p> <p>I tested this with pushing to a new screen with a webview, and this DOES work, but I want it all in the same screen</p> <p>Here is the code (obviously I've tried a few different things, and just left it in commented out):</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //EDITED to go to a webView instead of another table of info if (_webViewController == nil) { self.webViewController = [[[WebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]] autorelease]; } MWFeedItem *entry = [parsedItems objectAtIndex:indexPath.row]; _webViewController.entry = entry; //[self.navigationController pushViewController:_webViewController animated:YES]; [self presentModalViewController:_webViewController animated:YES]; //BELOW UNFINISHED SO EDITED OUT //self.webViewController._entry=[objectAtIndexPath:indexPath.row]; // Deselect [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; } </code></pre> <p>Not sure if my ViewController info is necessary, but here is an abridged version (placements are different, but everything else is the same)</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; [scroll setScrollEnabled:YES]; [scroll setContentSize:CGSizeMake(3840, self.view.frame.size.height)]; ScheduleRVC *_scheduleRVC = [[ScheduleRVC alloc] initWithNibName:@"ScheduleRVC" bundle:nil]; [_scheduleRVC.view setFrame:CGRectMake(408, 283, 340, 572)]; [scroll addSubview:_scheduleRVC.view]; MySchedule *_mySchedule = [[MySchedule alloc] initWithNibName:@"MySchedule" bundle:nil]; [_mySchedule.view setFrame:CGRectMake(10, 57, 340, 800)]; [scroll addSubview:_mySchedule.view]; WebViewController *_webViewController = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil]; [_webViewController.view setFrame:CGRectMake(408, 57, 340, 184)]; [scroll addSubview:_webViewController.view]; } </code></pre> <p><img src="https://i.stack.imgur.com/Ofk6U.jpg" alt="enter image description here"></p> <p>Please help (it will save a kitten)</p> <p><strong>--ADDITION</strong> If it helps any, here's the code that works pushing from the RSS to a WebView (but like I said, I want them to appear on the screen together, and SplitView won't work for what I'm doing)</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Show detail if (_webViewController == nil) { self.webViewController = [[[WebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]] autorelease]; } MWFeedItem *entry = [parsedItems objectAtIndex:indexPath.row]; _webViewController.entry = entry; [self.navigationController pushViewController:_webViewController animated:YES]; // Deselect [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload