gpt4 book ai didi

xcode - swift : Error with ParseUI and utf16Count not present

转载 作者:行者123 更新时间:2023-11-30 10:18:30 25 4
gpt4 key购买 nike

 func signUpViewController(signUpController: PFSignUpViewController!, shouldBeginSignUp info: [NSObject : AnyObject]!) -> Bool {
if let password = info?["password"] as? String
{
return password.utf16Count >= 8
}
else
{
return false
}
}

.utf16Count > 不存在我写了 return password.utf16 >= 8

错误::: 二元运算符 '>=' 无法应用于字符串、UTF16View' 和 'int' 类型的操作数

最佳答案

摘自 Xcode 6.3 beta 发行说明:

utf16Count is removed from String. Instead use count on the UTF16 view of the String.

所以你必须更换

return password.utf16Count >= 8

return count(password.utf16) >= 8

关于xcode - swift : Error with ParseUI and utf16Count not present,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28740061/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com