对TableViewController的开始/结束外观转换的不平衡调用

时间:2016-07-13 16:54:21

标签: ios swift uitableview transition facebook-sdk-4.0

当我试图通过调用方法邀请Facebook好友使用我的应用时,我遇到了问题。当我关闭FBSDKAppInviteDialog时,我收到以下错误:

  

对开始/结束外观转换的不平衡调用   < SettingsViewController:0x14df04e0>。

这是我的代码:

class SettingsViewController: UITableViewController, SKStoreProductViewControllerDelegate {

    //variables

    override func viewDidLoad() {
        super.viewDidLoad()

        //code
    }

    //other methods

    func inviteFriends() {
        let content = FBSDKAppInviteContent()
        content.appLinkURL = NSURL(string: "xxxxxxxx")
        content.appInvitePreviewImageURL = NSURL(string:"http://socialvip-app.com/images/share_img.png")
        FBSDKAppInviteDialog.showFromViewController(self, withContent: content, delegate: self)
    }

    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        let section=indexPath.section
        let row=indexPath.row
        switch section {
        case 0: switch row {
        case 0: inviteFriends()
        case 1: openFacePage()
        case 2:
            giveUsFiveIndicator.startAnimating()
            openStoreProduct()
            tableView.deselectRowAtIndexPath(indexPath, animated: true)
        default: break
            }
        case 2: switch row {
        case 0: logout()
        tableView.deselectRowAtIndexPath(indexPath, animated: true)
        case 1: deleteAccount()
        tableView.deselectRowAtIndexPath(indexPath, animated: true)
        default: break
            }
        default: break
        }
    }
}

extension SettingsViewController:FBSDKAppInviteDialogDelegate {

    func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didCompleteWithResults results: [NSObject : AnyObject]!) {
    }

    func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didFailWithError error: NSError!) {
    }
}

0 个答案:

没有答案