Sadece 2.0 sürümüyle güncellenmiş ve bir hata yaşıyorum.'array' kullanılamıyor: lütfen tembel dizinizden bir Dizi oluşturun: Array (...) error
alıyorum hatadır: 'dizisi' kullanılamaz: Tembel dizisinden bir dizi inşa edin: Array (...)
Benim kodudur:
if let credentialStorage = session.configuration.URLCredentialStorage {
let protectionSpace = NSURLProtectionSpace(
host: URL!.host!,
port: URL!.port?.integerValue ?? 0,
`protocol`: URL!.scheme,
realm: URL!.host!,
authenticationMethod: NSURLAuthenticationMethodHTTPBasic
)
// ERROR------------------------------------------------↓
if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values.array {
// ERROR------------------------------------------------↑
for credential: NSURLCredential in (credentials) {
components.append("-u \(credential.user!):\(credential.password!)")
}
} else {
if let credential = delegate.credential {
components.append("-u \(credential.user!):\(credential.password!)")
}
}
}
misiniz Swift 2.0 için güncellenmesi gereken bu kod satırı nasıl değiştirileceğini bilen var mı?
if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values.array
sizin xcode hangi versiyonu Swift 2.0 başlatıcı kullanılsın mı? – pixyzehn
Oyunumda çalışıyor. – pixyzehn
@pixyzehn bu sürüm 7 beta 6 – Bills