Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot pass messages between main view controller and popover view
    primarykey
    data
    text
    <p>I'm seem unable to get any kind of communication going between my Main View Controller and a Table View Controller which is being displayed inside a Popover View (iPad).</p> <p>I'm setting up the Table View inside a Navigation Controller in the usual way:</p> <pre><code>// create popover if (self.popoverController == nil) { filesViewController = [[[MyTableViewController alloc] initWithFiles:fileList] autorelease]; UINavigationController *navCtrl = [[[UINavigationController alloc] initWithRootViewController:filesViewController] autorelease]; self.popoverController = [[UIPopoverController alloc] initWithContentViewController:navCtrl]; self.popoverController.delegate = self; // resize popover self.popoverController.popoverContentSize = CGSizeMake(320.0, 44 + [fileList count] * 44); } </code></pre> <p>Everything is working fine, and I'm passing an array of file names (fileList) into the Table View, which is held in the Table View as an array called listOfFiles. The Table View displays the filenames, and when one is selected by the user I want to pass that filename back to the Main View Controller. However, I cannot get any communication going back from the Table View's didSelectRowAtIndexPath method to the Main VC. I've tried all sorts of outlets going in various directions, and I've tried creating a new object in didSelectRowAtIndexPath to handle the filename coming from the Table View. I can pass the filename out to the new object, but when I try to send that into the Main VC it is null again. Everything I send to my Main VC while that popover is active comes up as null. </p> <pre><code> - (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController { NSLog(@"%@", handler.addressForImageFile); self.popoverController = nil; [self.popoverController release]; } </code></pre> <p>Is there some reason why my Main VC won't get anything but null objects from my Table View? I've spent days trying so many different things. I feel like there's some fundamental gap in my knowledge of how popovers work. Surely there is a simple way to send a string back to my Main VC when it is selected from the Table View?</p> <p>Thanks so much for any help!</p>
    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