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!) {
}
}