【发布时间】:2015-07-06 19:40:05
【问题描述】:
我正在尝试创建一个提醒,当它出现时会询问用户是否要从他们的照片库中选择一张照片或拍照。我正在使用UIPopover How do I make a popover with buttons like this? 帖子中的模板。模板是...
UIAlertController * alertController = [UIAlertController alertControllerWithTitle: nil
message: nil
preferredStyle: UIAlertControllerStyleActionSheet];
[alertController addAction: [UIAlertAction actionWithTitle: @"Take Photo" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
// Handle Take Photo here
}]];
[alertController addAction: [UIAlertAction actionWithTitle: @"Choose Existing Photo" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
// Handle Choose Existing Photo here
}]];
alertController.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController * popover = alertController.popoverPresentationController;
popover.permittedArrowDirections = UIPopoverArrowDirectionUp;
popover.sourceView = sender;
popover.sourceRect = sender.bounds;
[self presentViewController: alertController animated: YES completion: nil];
但是在popover.sourceRect = sender.bounds; xcode 给我一个错误,指出Property 'bounds' not found on object of type '__strong id'。这个错误是什么意思?如何解决?
【问题讨论】:
标签: ios objective-c xcode uialertcontroller