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

如下是报错需要修改的源码:

//        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

//        }

修改如下:

 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         }

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

时间: 2024-07-29 09:24:33

'String' does not conform to protocol 'CollectionType' Error in Swift 2.0的相关文章

Swift 实现UITableView报错, does not conform to protocol &#39;UITableViewDataSource&#39;

Swift语言中的UITableView中着实很坑爹,为什么呢,因为在遵循协议后经常会报这样的错误:does not conform to protocol 'UITableViewDataSource'.而且是第一次尝试的伙伴们经常会发现,我写的代码没有问题呀,该写的都写了,为什么还是报错呢,有的时候是xcode的问题,有的时候又是自己遵循的协议中有必需实现的方法而没有实现导致的.所以遇到这种问题,大家不妨跳进代理中去看看必须实现的方法都实现的没有. 下面是我写的一个小demo,大家可以看看.

启动监听报错:TNS-12537: TNS:connection closed TNS-12560: TNS:protocol adapter error TNS-00507: Connection closed Linux Error: 29: Illegal seek

启动监听程序报错: 说明:在rhel5.8上安装完成oracle11g数据库后,使用netca创建完监听,启动监听时报错.还未使用dbca创建实例. [[email protected] ~]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-APR-2015 08:33:53 Copyright (c) 1991, 2009, Oracle. All rights reserved. Starting

A const field of a reference type other than string can only be initialized with null Error [duplicate]

I'm trying to create a 2D array to store some values that don't change like this. const int[,] hiveIndices = new int[,] { {200,362},{250,370},{213,410} , {400,330} , {380,282} , {437, 295} , {325, 405} , {379,413} ,{343,453} , {450,382},{510,395},{46

[IOS]Type &#39;NSObject&#39; does not conform to protocol &#39;NilLiteralConvertible&#39;

在使用一个cell的时候发生的, func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView .dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell if(cell ==

TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error:

今天是2014-06-17,遇到一个非常奇怪的问题,可能之前测试修改监听的原因,导致监听启动后自动关闭,特此记录一下整个处理过程, 监听配置文件信息如下: [[email protected] admin]$ more listener.ora # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora # Generated by Or

Swift 给UITableView 写extension 时 报错 does not conform to protocol &#39;UITableViewDataSource&#39;

那是因为你没有实现 数据源和代理方法 实现下就好了 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { return UITableViewCell() } Sw

Swift开发教程--实现UITableView报错does not conform to protocol &#39;UITableViewDataSource‘

通过实践,要是把下面三个协议方法都实现了就不会报错了.另外还需要注意!的问题. func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{ } func tableView(ta

oracle plsql 无法连接 报 ORA-12560: TNS:protocol adapter error

ORA-12560: TNS:protocol adapter error 添加一个环境变量,名为TNS_ADMIN,值为 tnsnames.ora 文件所在路径.比如我的本机为:D:/instantclient_11_2/network/admin

type &#39;simple Class&#39; does not conform to protocol &#39;Example Protocol&#39;错误

在看swift教程中"接口和扩展"这小部分.在编写时提示"type 'simple Class' does not conform to protocol 'Example Protocol'"的错误,原因是simpleClass没有完全实现protocol中定义的方法.检查了下代码,原来是自己把方法名给写错了. mutating 只针对 struct 和 enum  . type 'simple Class' does not conform to protoco