gpt4 book ai didi

ios - 函数签名特化

转载 作者:搜寻专家 更新时间:2023-11-01 05:39:45 26 4
gpt4 key购买 nike

我有一个 UIPageViewController三嵌入式UINavigationController秒。该应用程序在我的设备上运行完美,但在其他一些测试设备上,我遇到了崩溃:function signature specialization <Arg[0] = Owned To Guaranteed>在 Crashlytics 中。

这是我在 Crashlytics 中获得的报告。

enter image description here

这是我用来设置我的 UIPageViewController 的代码.

import Foundation
import UIKit
import Parse

class PageViewController: UIPageViewController, UIPageViewControllerDataSource, UIPageViewControllerDelegate {

private var pages: [UINavigationController]!

private var currentPageIndex: Int!

override func viewDidAppear(animated: Bool) {

if (FBSDKAccessToken.currentAccessToken() != nil) {


} else {

self.performSegueWithIdentifier("toSignup", sender: self)

}
}

override func viewDidLoad() {
super.viewDidLoad()

// Page view controller is initial VC, but if FB Access Token is nil, redirect to signup flow
if (FBSDKAccessToken.currentAccessToken() != nil) {

self.dataSource = self
self.delegate = self

self.pages = [
self.storyboard!.instantiateViewControllerWithIdentifier("DiscoverNav") as! UINavigationController,
self.storyboard!.instantiateViewControllerWithIdentifier("LiveFeedNav") as! UINavigationController,
self.storyboard!.instantiateViewControllerWithIdentifier("ProfileNav") as! UINavigationController
]

(self.pages[0].topViewController as! DiscoverViewController).parentPageViewController = self
(self.pages[1].topViewController as! LiveFeedViewController).parentPageViewController = self
(self.pages[2].topViewController as! ProfileViewController).parentPageViewController = self


self.currentPageIndex = 1
let startingViewController = self.pages[1] as UINavigationController
self.setViewControllers([startingViewController], direction: .Forward, animated: false, completion: nil)

} else {

self.performSegueWithIdentifier("toSignup", sender: self)

}

}

func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController? {
let index = (self.pages as NSArray).indexOfObject(viewController)
self.currentPageIndex = index

// if currently displaying last view controller, return nil to indicate that there is no next view controller
return (self.currentPageIndex == self.pages.count - 1 ? nil : self.pages[self.currentPageIndex + 1])
}

func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? {
let index = (self.pages as NSArray).indexOfObject(viewController)
self.currentPageIndex = index

// if currently displaying first view controller, return nil to indicate that there is no previous view controller
return (index == 0 ? nil : self.pages[index - 1])
}



func displayPageForIndex(index: Int, animated: Bool = true) {
assert(index >= 0 && index < self.pages.count, "Error: Attempting to display a page for an out of bounds index")

// nop if index == self.currentPageIndex
if self.currentPageIndex == index { return }

if index < self.currentPageIndex {
self.setViewControllers([self.pages[index]], direction: .Reverse, animated: true, completion: nil)
} else if index > self.currentPageIndex {
self.setViewControllers([self.pages[index]], direction: .Forward, animated: true, completion: nil)
}

self.currentPageIndex = index
}

}

现在看来崩溃似乎来自 ProfileViewController.swift ,但是当 UIPageView 时,该页面不会调用任何内容。负载。在 Crashlytics 报告的第 16 和 17 行,它指向 PageViewController。那里似乎没有太多关于此错误的信息,但从我读到的内容来看,它似乎与某处的 nil 值有关。谁能就此提供建议?

PageViewController 的第 47 行指向 self.storyboard!.instantiateViewControllerWithIdentifier("ProfileNav") as! UINavigationController

最佳答案

事实证明,一些测试用户正试图从他们的 Gmail 应用程序打开 TestFlight 邀请,显然你不应该这样做。我告诉他们从 Safari 或 Apple Mail 打开,它起作用了。感谢额外的头痛 TestFlight。

关于ios - 函数签名特化 <Arg[0] = Owned To Guaranteed>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32030531/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com