Cocoa Touch – iPad detection UIPOPOVERCONTROLLERS is turned off

There are several uiPopoverControllers in my universal iPad application. Once a popover is closed, I now have a request to trigger a function. If the user clicks “close” in the pop-up window, I can do this easily, but if I touch the screen to hide the popover, I can’t trigger my function.

I have been searching for a while and can’t seem to find any proxy method, I You can use it in my main view controller to capture them. I would like the didDismissPopoverController stuff, but my guess is no.

If not, the only thing I want to do is to detect triggers and triggers ? Basically I highlight a UITableView row and load the popover. I need to deselect the row-so I want to simply call [table reloaddata].

Thank you for any help with this!

You need to assign a delegate to UIPopoverController, and then implement – ​​(void)popoverControllerDidDismissPopover: (UIPopoverController *) popoverController method. For example:

@interface FooController: UIViewController  {
// ...
}
/ / ...
@end

When you instantiate UIPopoverController (for example, in FooController in this example)…

UIPopoverController *popover = // ...
popover.delegate = self;

Then, you will implement the method:

- (void )popoverControllerDidDismissPopover:(UIPopoverController *)popoverController {
// do something now that it's been dismissed
}

I haven’t tested it, but it seems to work…

Hope this helps!

There are several uiPopoverControllers in my universal iPad app. Once a popover is closed, I now have a requirement to trigger a function. If the user clicks in the pop-up window “Close”, I can do this easily, but if I touch the screen to hide the popover, I can’t trigger my function.

I have been searching for a while and can’t seem to find any Proxy method, I can use it in my main view controller to capture them. I would like the didDismissPopoverController stuff, but my guess is none.

If not, the only thing I want to do is Detect trigger and trigger? Basically I highlight a UITableView row and load the popover. I need to deselect the row-so I want to simply call [table reloaddata].

Thank you for any help with this!

You need to assign a delegate to UIPopoverController, and then implement – ​​(void)popoverControllerDidDismissPopover: (UIPopoverController *)popoverController method. For example:

@interface FooController: UIViewController  {
// ...
}
// ...
@end

When you instantiate UIPopoverController (for example, in FooController in this example)...

UIPopoverController *popover = // ...
popover.delegate = self;

Then, you will implement the method:

- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController {
// do something now that it's been dismissed
}

I haven't tested it, but it seems to work...

Hope this helps!

Leave a Comment

Your email address will not be published.