4
如何迅速的iOS 8.0即Type 'String!' does not conform to protocol 'Equatable'
鍵入'String!'不符合協議「Equatable」
這裏解決,這是我的代碼
func connection(connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: NSURLProtectionSpace?) -> Bool
{
return protectionSpace?.authenticationMethod == NSURLAuthenticationMethodServerTrust
// Here I got this error near == sign
}
func connection(connection: NSURLConnection, didReceiveAuthenticationChallenge challenge: NSURLAuthenticationChallenge?)
{
if challenge?.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust
{
if challenge?.protectionSpace.host == "www.myhost.com"
// Here I got this error near == sign
{
let credentials = NSURLCredential(forTrust: challenge!.protectionSpace.serverTrust)
challenge!.sender.useCredential(credentials, forAuthenticationChallenge: challenge)
}
}
challenge?.sender.continueWithoutCredentialForAuthenticationChallenge(challenge)
}
您是否正在運行舊的xcode6測試版? – 2014-09-25 09:05:48
@MikePollard是的我是 – 2014-09-25 10:15:38
升級到Xcode 6.0.1,一切都會好的。 – 2014-09-25 10:16:56