3

I added a UIButton to a UICollectionView header. I like to instigate a popover segue from the button to a UITableViewController.

  • I control-drag from the button on the collection view header to the tableView Controller and choose present as popover segue.
  • When I build the project, I receive the following error:

Main.storyboard:

error: Couldn't compile connection: <IBCocoaTouchOutletConnection:
   0x7fd0436bc660  source=<IBProxyObject: l2l-iC-wi9 'Placeholder for
   UIStoryboardPopoverPresentationSegueTemplate with OID iIR-Qd-1S2'>
   property=anchorView  destination=<IBUIButton: xWf-K4-adt 'Anchor
   View'>>

Notes

  • if I choose to initiate other types of segues, they all work fine.

  • if the button is not located in the header of a UIcollectionView (e.g., UIViewController,UIView) , the popover segue works fine too.

Victor Sigler
  • 23,243
  • 14
  • 88
  • 105
  • I am new to iOS programming. Your help is highly appreciated. Providing me with examples to follow is very appreciated too. – Munira Faysal Aug 27 '15 at 22:17
  • This issue is now 3.5 years old, with no answers, and I just had the same thing happen to me. This is also the only search result for `Couldn't compile connection UIStoryboardPopoverPresentationSegueTemplate`. – NRitH Apr 18 '19 at 15:55

1 Answers1

0

I ran into this as well. The header (or cell) is only a proxy for the real one, as there may be multiple. In the storyboard, just anchor from the main collectionView itself, then you can change the anchor to point to the correct cell during prepareforSegue.

In cell's button action, call

[self peformSegue: @"SegueName" sender: cell]

then in prepareForSegue, call

segue.destinationViewController.popoverPresentationController.sourceView  =  (UIView *) sender
segue.destinationViewController.popoverPresentationController.sourceRect  = ((UIView *) sender.bounds`
mackworth
  • 5,873
  • 2
  • 29
  • 49