I am trying to dismiss a UIPopoverViewControler from a button in the Popover. In addition I want it to transfer the data back to the main view. I have it working for a modalViewController but not for a Popover. Does anyone know how I can achieve this?
//popover
- (IBAction) save:(id)sender
{
if ([self startDateIsValid] && [self endDateIsValid])
{
[[self parentViewController] setDatesForEvent:startDate eventEndDate:endDate allDay:[allDaySwitch isOn]];
[self dismissModalViewControllerAnimated:YES];
}
}
//AddEventViewController_iPad
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "dateViewPopOverViewController_iPad.h"
@interface AddEventViewController_iPad : UIViewController <UITableViewDelegate,UITableViewDataSource, MFMailComposeViewControllerDelegate, UITextFieldDelegate, UIAlertViewDelegate,UIPopoverControllerDelegate,UINavigationControllerDelegate,UIPopoverControllerDelegate,ABPeoplePickerNavigationControllerDelegate, ABNewPersonViewControllerDelegate,DismissPopoverDelegate> {
//datePopover
#import <UIKit/UIKit.h>
#import "AddEventViewController_iPad.h"
@protocol DismissPopoverDelegate <NSObject>
- (void) dismissWithData:(NSString *)data;
@end
@interface dateViewPopOverViewController_iPad : UIViewController<UIPopoverControllerDelegate> {
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…