Cannot call value of non-function type 'UITextView'报错
iOS里面的开发,类写到一半就报错这个。后来发现是因为重名的时候召唤对象不明确的问题。先贴代码,晚点再说
//ヒントをクリアするためのイニシャライザ
init (clearStr: UITextView, clearSco: UITextView) {
nowCombi = "" //ダミー
clearStr(strTextView: clearStr, scoTextView: clearSco)
}
//化合物のヒントの文字列を作るクラス
class CombiHint {
private let nowCombi: String
private var hintString: String = ""
private var hintScore: String = ""
private let systemFontAs20: UIFont = UIFont.systemFont(ofSize: 20)
//-----------------イニシャライザ-------------------
//何もしない簡単なイニシャライザ
init(nowCombi temp: String) {
nowCombi = temp
}
//ヒントを作る処理をするイニシャライザ originStrToBeProcessed
convenience init(oriToBePro temp: String) {
self.init(nowCombi: temp)
hintPro()
}
//ヒントを作ってテキストビューに設定するイニシャライザ
convenience init(oriToBePro temp: String, stringTextView: UITextView, scoreTextView: UITextView) {
self.init(nowCombi: temp)
hintPro()
stringTextView.text = hintString
scoreTextView.text = hintScore
stringTextView.font = getFontSizeAsDefault()
scoreTextView.font = getFontSizeAsDefault()
}
//ヒントをクリアするためのイニシャライザ
init (clearStr: UITextView, clearSco: UITextView) {
nowCombi = "" //ダミー
self.clearStr(strTextView: clearStr, scoTextView: clearSco)
}
//---------------------関数-----------------------
//関数1.1
//ヒントの文字列を作る
private func hintPro() {
for combi in cardComRef {
if nowCombi == "C" {
if combi.ref == .Cl2 || combi.ref == .CuO || combi.ref == .CuS || combi.ref == .CuCl2 {
continue
}
}
if combi.ref.rawValue.hasPrefix(nowCombi) {
let stringConv = StringAdapter(origin: combi.ref.rawValue, ouType: .under)
//hintString += combi.ref.rawValue + "\n"
hintString += stringConv.getResult() + "\n"
hintScore += String(Int(combi.card.rawValue)) + "\n"
}
}
}
//関数2.1
//文字サイズが20のフォントを取得
func getFontSizeAsDefault() -> UIFont {
return systemFontAs20
}
//関数2.2
//自分の好きな文字サイズを設定
func getFontSize(howMuch: Double) -> UIFont {
return UIFont.systemFont(ofSize: CGFloat(howMuch))
}
//関数3.1
//hintStringを取得
func getHintString() -> String {
return hintString
}
//関数3.2
//hintScoreを取得
func getHintScore() -> String {
return hintScore
}
//関数3.3
//hintStringとhintScoreを一括に取得
func getHStringAndHScore() -> (hintString: String, hintScore: String) {
return (hintString: getHintString(), hintScore: getHintScore())
}
//関数4.1
//テキストビューの文字列をクリアする
private func clearStr(strTextView: UITextView, scoTextView: UITextView) {
strTextView.text = ""
scoTextView.text = ""
}
}
Cannot call value of non-function type 'UITextView'报错的更多相关文章
- JS function document.onclick(){}报错Syntax error on token "function", delete this token
JS function document.onclick(){}报错Syntax error on token "function", delete this token func ...
- "XX cannot be resolved to a type "eclipse报错及解决说明
转自:http://zhaoningbo.iteye.com/blog/1137215 引言: eclipse新导入的项目经常可以看到“XX cannot be resolved to a type” ...
- "XX cannot be resolved to a type "eclipse报错及解决
好久都没有写博了,还记得自己准备考研,结果你会发现——你永远不知道,你将会走上哪个路. 长远的目标是好的,但有些时候身不由己也迫不得已!做好自己的当下就是好的. 不论搞什么,总会遇到各种各样的问题,以 ...
- mysql5.5碰到的type= MyISAM报错问题
最近把mysql升级到5.5版本,发现type= MyISAM报错,网上查了一下原来MYSQL5.5.x 版本 不支持 TYPE=MyISAM 这样的语句了!!! MYSQL语句写法 TYPE=My ...
- JS function document.onclick(){}报错Syntax error on token "function", delete this token - CSDN博客
原文:JS function document.onclick(){}报错Syntax error on token "function", delete this token - ...
- std::unique_ptr使用incomplete type的报错分析和解决
Pimpl(Pointer to implementation)很多同学都不陌生,但是从原始指针升级到C++11的独占指针std::unique_ptr时,会遇到一个incomplete type的报 ...
- TypeError: value.getTime is not a function (elementUI报错转载 )
"TypeError: value.getTime is not a function" 2018年07月02日 16:41:24 leeleejoker 阅读数:2091 标签: ...
- ie8下修改input的type属性报错
摘要: 现在有一个需求如图所示,当用户勾选显示明文复选框时,要以明文显示用户输入的密码,去掉勾选时要变回密文,刚开始想到的就是修改输入框的type来决定显示明文还是密文,使用jQuery的attr来做 ...
- Mac下Android绘制点9格式png以及解决IllegalArgumentException: Unknown image type 0报错
在Mac下的AndroidStudio中,右键png图片选择“create 9-patch-file”时会报错:IllegalArgumentException: Unknown image type ...
随机推荐
- 使用fiddler进行手机数据抓取
使用fiddler进行手机数据抓取 学习了:https://blog.csdn.net/gld824125233/article/details/52588275 https://blog.csdn. ...
- 嵌入式程序员应知道的0x10个C语言Tips
[1].[代码] [C/C++]代码 跳至 [1] ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ...
- hive cli 启动缓慢问题
hive-0.13.1启动缓慢的原因 发现时间主要消耗在以下3个地方: 1. hadoopjar的时候要把相关的jar包上传到hdfs中(这里大概消耗5s,hive0.11一样,这个地方不太好优化) ...
- DBExecutor android 数据库框架
https://github.com/eltld/DBExecutor android 数据库框架,sqlite database
- 读写锁(pthread)
读写锁: 用于对于某个给定资源的共享访问,而不是像互斥锁那样,将所有试图进入临界区的线程都阻塞住 相关内容: 线程互斥锁 分配规则:(写独占,读共享) 1.只要没有线程持有某个给定的读写锁用于写,那么 ...
- java 的File文件
文件是计算中一种主要的数据存储形式. 首先介绍一下,绝对路径和相对路径.绝对路径是书写完整路径,相对路径是值书写文件的部分路径. d:\java\hello.java 就是据对路径.包括完整的路径d ...
- POJ 1183 反正切函数的应用(数学代换,基本不等式)
题目链接:http://poj.org/problem?id=1183 这道题关键在于数学式子的推导,由题目有1/a=(1/b+1/c)/(1-1/(b*c))---------->a=(b*c ...
- 文件宝iOS/iPhone/iPad客户端简介
App Store地址:https://itunes.apple.com/cn/app/id1023365565?mt=8 文件宝-装机必备的文件管家,专业的rar-zip 解压工具,局域网看片神器, ...
- 2016/05/27 php上传文件常见问题总结
php上传文件常见问题总结 投稿:hebedich 字体:[增加 减小] 类型:转载 时间:2015-02-03我要评论 这篇文章主要介绍了php上传文件常见问题总结,基本上经常碰到的问题的处理都列了 ...
- 20170218 OO-ALV标准工具栏按钮
原文地址:OO ALV 工具栏对于的功能码 图标与对应的 功能码 明细 &DETAIL 检查 &CHECK 刷新 &REFRESH 剪切 &LOCAL&CU ...