我已经从一个viewcontroller到另一个viewcontroller设置了一个“show detail”segue。但是当我执行下面的代码没有任何反应时,它不会显示viewController。我100%认为segue中的标识符是相同的。这可以做什么呢?
self.performSegueWithIdentifier("PresentPermissionView", sender: self)
我在这个方法中称呼它
func determinePermission() {
switch CLLocationManager.authorizationStatus() {
case .AuthorizedAlways, .AuthorizedWhenInUse:
if CLLocationManager.locationServicesEnabled() {
}
case .NotDetermined:
locationManager.requestWhenInUseAuthorization()
print("test")
case .Restricted, .Denied:
print("restricted")
self.performSegueWithIdentifier("PresentPermissionView", sender: self)
}
}
答案 0 :(得分:0)
你在哪里称这种方法?
尝试记录它是否真的准备通过覆盖来执行segue:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)
{
print("Preparing for segue using: \(segue)")
print("With it's destination view controller: \(segue.destinationViewController)")
}
override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool
{
return true
}
答案 1 :(得分:0)