我将 Xcode 更新为新的 Xcode 7 beta 5。这样做时,它转换为 Swift 2,但随后产生了更多错误。现在,我完全陷入困境,不知道该怎么办,因为虽然我所有的错误都消失了,但我的应用程序将无法正常工作。
我的问题是这样的:
if(self.myOutput3 as? NSObject == true) {
print("IT IS TRUE")
PFUser.logInWithUsernameInBackground(self.myOutput1 as! String, password: "xxx") { (user: PFUser?, error: NSError?) -> Void in
if error == nil {
print("It Worked!")
// self.presentViewController(destViewController, animated: true, completion: nil)
let instillation = PFInstallation.currentInstallation()
instillation["user"] = PFUser.currentUser()
instillation.saveInBackgroundWithBlock(nil)
self.performSegueWithIdentifier("toTimeline", sender: self)
} else {
// self.enterButton.enabled = false
self.errorAlert()
print("Couldn't log in...")
}
}
} else {
print("IT IS FALSE")
self.performSegueWithIdentifier("continueTheSignIn", sender: self)
// self.move()
}
该程序将执行toTimeline segue,但不执行continueTheSignIn。我看不出这不起作用的任何合乎逻辑的原因。谁能指出我正确的方向?
另外,我的消息功能出现错误。
cell.textView!.linkTextAttributes = [NSForegroundColorAttributeName:cell.textView!.textColor]
这给了我错误“无法将'[String:UIColor?]'类型的值分配给'[String:AnyObject]!'类型的值
我以前在 Swift / Xcode 6.4 中没有遇到这个错误,所以我不知道如何修复它。
此外,一旦我绕过这个进入我的应用程序以查看我的其他功能是否正常工作,我的大多数 UITableViews 都不会显示任何信息。一个是,但是其余的加载正确数量的行,但什么也不显示。这可能是什么?此外,也没有正确显示 Parse 图片。这些比其他问题更令人担忧……