Retrieveing value from popover and closing from viewController
===

http://mobiforge.com/designing/story/using-popoverview-ipad-app-development

I followed the above example, making a few modifications.  Where I am loosing it is the closing of the popover and sending item back to the parent view controller.

I have a popover with an textfield and saveButton.  When the users clicks the save button I would like to retrieve the textfield value and close the popover.

Main view controller:

    - (IBAction)saveButton:(id)sender {
      if (self.popoverController == nil){
        saveViewController *svc = [self.storyboard instantiateViewControllerWithIdentifier:@"saveViewController"];
        UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:svc];
        
        
        popover.delegate = self;
       // [svc release];
        self.popoverController = popover;
        [popover release];
      }
      CGRect popoverRect = [self.view convertRect:[sbtn frame] fromView:[sbtn superview]];
      popoverRect.size.width = MIN(popoverRect.size.width, 100);
      [self.popoverController presentPopoverFromRect:popoverRect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    }

...

    -(void)setDetailItem:(id)newDetailItem{
      
      if(detailItem != newDetailItem){
        [detailItem release];
        detailItem = [newDetailItem retain];
        
        blindName = detailItem;
      }
      if (popoverController != nil){
        [popoverController dismissPopoverAnimated:YES];
      }
    }

Popover view controller:

    - (IBAction)saveButton:(id)sender {
      NSLog(@"Saved");
    
      ptAppDelegate *app = (ptAppDelegate *)[[UIApplication sharedApplication] delegate];
    
      app.viewController.detailItem = saveName;
      
    }

The big issue I have here is that "app.viewController" doesn't exist.  Do I need to make my viewController a delegate of the ptAppDelegate? Totally lost.  Thanks for the help
