简体   繁体   中英

Compile error trying to perform popover segue from a dynamic UITableViewCell

I'm trying to connect a dynamic UITableViewCell to a navigation controller in a storyboard using a popover segue .
To do that I ctrl-dragged from the cell to the navigation controller, selected "popover" as segue and then assigned an identifier to it. In this way the anchor point of the segue becomes the cell.

With this configuration I get this error from the compiler:

Couldn't compile connection: <IBCocoaTouchOutletConnection:0x40114c920  <IBProxyObject: 0x40114c540> => anchorView => <IBUITableViewCell: 0x4012576c0>>

What I want to do is simply to open a popover controller every time a cell is selected. There's no error if I try to do the same but specifying another kind of segue (push or modal...). I have already tried to create a new sample project from scratch with only the required components but the error persists.

Thanks for reading.

在此输入图像描述

在此输入图像描述

The simple solution is to change the popover anchor point to something else 'static' in your view. In my case, a UIBarButtonItem that is the anchor for the 'add' action'.

This is done by dragging from the circle to the right of Anchor box to the item on the storyboard you wish to use as the anchor.

在此输入图像描述

Looking at your UI, it looks like you are creating an application for iPhone, and the popover segue is available for iPad only. That could be the reason.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM