0

I'm trying to use NYTPhotoViewer to open a message from JSQMessagesViewController. After much research, I feel like I have the code correct, but continue to get the error "unrecognized selector sent to instance". Here is the code:

override func collectionView(collectionView: JSQMessagesCollectionView, didTapMessageBubbleAtIndexPath indexPath: NSIndexPath!) {
    super.collectionView(collectionView, didTapMessageBubbleAtIndexPath: indexPath)

    var photos = [UIImage]()

    if messages[indexPath.item].isMediaMessage {

        let mediaItem: JSQMessageMediaData = messages[indexPath.item].media
        let photoItem: JSQPhotoMediaItem = mediaItem as! JSQPhotoMediaItem
        let image: UIImage = photoItem.image

        photos.append(image)
    }

    let photosViewController: NYTPhotosViewController = NYTPhotosViewController(photos: photos)
    presentViewController(photosViewController, animated: true, completion: nil)
}

Any help would be greatly appreciated!!

Thanks

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Robert
  • 1,499
  • 2
  • 14
  • 22

1 Answers1

0

This could be as simple as an IBoutlet that is not hooked up. If you select the view controller and the last option on the side panel you can see all your hookups. If any are to old things that don't exist they will have a different symbol beside them. It looks like a vertical switch delete that and it should work. Other wise we need more information. If you could add the console out put that may help.

Dan Leonard
  • 3,325
  • 1
  • 20
  • 32