내 스토리 보드 항목 포인트 역할을하는보기의 ViewDidLoad 메서드에 if ... then 문이 있습니다.Segue가 작동하지 않아 이유를 알 수 없습니다.
기본적으로 핵심 데이터에 작은 "설정 양식"을 완료했음을 나타내는 데이터가 있는지 확인하고 있습니다.
핵심 데이터가 비어 있거나 앱이 올바르게 설정되지 않은 것으로 판단되면 자동으로 설정보기로 넘어가도록하고 싶습니다.
내있는 viewDidLoad 방법은 다음과 같습니다
override func viewDidLoad() {
super.viewDidLoad()
//Get any entries from the App Settings Entity
getAppSettings()
//If any entries are found, check to see if the setup has been completed
if (appSettings.count > 0) {
print("We found entries in the database for App Settings")
if (appSettings[0].setupComplete == false) {
print("Setup has not been completed")
self.performSegue(withIdentifier: "toAppSettings", sender: self)
} else {
print("Setup is completed")
//Load the settings into global variables
preferredRegion = appSettings[0].region!
usersName = appSettings[0].usersName!
}
} else {
print("We found no entries in the database for App Settings")
self.performSegue(withIdentifier: "toAppSettings", sender: self)
}
}
나는 SEGUE가 존재하는 것을 확인했다, 그리고 SEGUE의 식별자가 나는 (I도 & 모든 붙여 복사 한 따옴표를 정확히이다 그것들이 모두 일관성이 있는지 확인하기위한 경우).
또한 여분의 마일을 가서 그것을 호출하기되었는지 여부를 인쇄하려면 "준비 SEGUE위한"방법에 검사기를 넣어 보낸 사람이 누구인지 :
이override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
print("We're getting ready to segue!")
print(segue.identifier)
}
가 해당 항목 모두가 인쇄되는 이 로그는 segue가 인식되고 있으며 앱이이를 시도하고 있음을 알려줍니다. 그러나 - 내가 알 수없는 몇 가지 이유 때문에 - 단순히 발사가 아닙니다.
내가 여기에 놓친 아이디어가 있습니까?