"취소"작업과 무언가를하는 처리기에서만 반환하는 경고 컨트롤러가있는 사람이 있습니까?UIAlertController가 취소되면 설정을 가리키고 있습니다.
광산
내가 그 않는 다른의 ViewController에서 다른 경고 컨트롤러가 .... 응용 프로그램 설정으로 이동합니다. 그러나 이것에 영향을 미치지 않습니다 ????alertControl.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: { (alertAction) -> Void in
return
}))
갱신 :
다른 모든 alertController을 댓글. (그들은 다른 뷰 컨트롤러에 모두 포함되어있었습니다.) 이제는 더 이상 작동하지 않습니다. 이게 뭐야 ??
이는 뭔가 잘못되었을 때만 함수에서 선언됩니다. 연결이 없을 때 ... 함수가 호출되지 않으면 존재하지 않아야합니다.
업데이트 2 :
func checkAllSettingsForLocation() {
if isTest != true {
//println("should show this")
let alertController = UIAlertController(title: "Scenix can't use your location", message: "Check Location Services under Privacy in the Settings App", preferredStyle: UIAlertControllerStyle.Alert)
let goToSettingsAction = UIAlertAction(title: "Go to Settings", style: .Default, handler: {
action in
UIApplication.sharedApplication().openURL(NSURL(string:UIApplicationOpenSettingsURLString)!)
return
}
)
alertController.addAction(goToSettingsAction)
let ignoreNoCamAction = UIAlertAction(title: "Cancel", style: .Default, handler: {
action in
self.launch = self.launch - 1
return
}
)
alertController.addAction(ignoreNoCamAction)
self.presentViewController(alertController, animated: true, completion: nil)
}
}
업데이트 3 :
점점 더 많은 엑스 코드의 버그처럼 보인다.
출시/통과 테스트 비행을위한 건물과 버그가 있습니다. 경고 컨트롤러 제목을 확인하는 if 문에서
더러운 수정 =>
랩 어떤 경고 컨트롤러에서 작업을 .... 정상적인 디버그 빌드를 수행하고 모두 괜찮습니다. 절대로 예외를 던지거나 아무 것도 찾지 못해서 내 문제를 해결할 수 없습니다.
더 많은 컨텍스트를 표시 할 수 있습니까? 이 두 "충돌하는"경보 컨트롤러는 어디에서 어떻게 선언됩니까? 감사. – matt
모든 경고 컨트롤러가 함수로 선언됩니다. 뭔가 잘못되면 않는 한 그들은 존재할 필요가 없습니다. 일을하고있는 사람은 세 번째 viewcontroller에 살기로되어 있지 않습니다. 처음에는 다른 사람들. (내비게이션 할 때) –
p.s. alertcontroller/alerts/handler는 모두 다른 이름을 가지고 있습니다. –