我試圖檢測UIPopoverController被解僱時,但它似乎不能正常工作,方法沒有被調用。這是我呈現UIPopoverController代碼:UIPopoverController不觸發委託方法
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.delegate = self;
UIPopoverController *popoverVC = [[UIPopoverController alloc] initWithContentViewController:imagePickerController];
popoverVC.delegate = self;
[popoverVC presentPopoverFromRect:CGRectMake(self.frame.origin.x,self.frame.origin.y, self.frame.size.width, self.frame.size.height) inView:[home view] permittedArrowDirections:0 animated:YES];
我試圖觸發此方法,但沒有得到所謂:
- (void) popoverControllerDidDismissPopover:(UIPopoverController *) popoverController;
而且我確實增加了委託頭:
@interface Map : UIView <UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIGestureRecognizerDelegate, UIScrollViewDelegate,UIPopoverControllerDelegate>
我不知道我錯過了什麼,根本不工作。
謝謝你,我想出瞭如何使它工作,我發佈它作爲答案,這是它與其他東西的組合。 –