'String' does not conform to protocol 'CollectionType' Error in Swift 2.0

以下是報錯須要修改的源碼:spa

//        if count(currentPassword) < 6 || count(newPassword) < 6 || count(confirmPassword) < 6  {

//            var failAlertView = UIAlertView(title: Localized.ACCOUNT_HINT_PASSWORD , message: nil, delegate: self, cancelButtonTitle: Localized.DIALOG_BUTTON_OK)

//            failAlertView.show()

//            return

//        }

修改以下:code

 1     func setPassword(currentPassword: String, newPassword: String, confirmPassword: String) {
 2 
 3         //may
 4 
 5         if currentPassword.characters.count < 6 || newPassword.characters.count < 6 || confirmPassword.characters.count < 6 {
 6 
 7             let failAlertView = UIAlertView(title: Localized.ACCOUNT_HINT_PASSWORD , message: nil, delegate: self, cancelButtonTitle: Localized.DIALOG_BUTTON_OK)
 8 
 9             failAlertView.show()
10 
11             return
12 
13         }
相關文章
相關標籤/搜索