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'报错的更多相关文章

  1. 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 ...

  2. "XX cannot be resolved to a type "eclipse报错及解决说明

    转自:http://zhaoningbo.iteye.com/blog/1137215 引言: eclipse新导入的项目经常可以看到“XX cannot be resolved to a type” ...

  3. "XX cannot be resolved to a type "eclipse报错及解决

    好久都没有写博了,还记得自己准备考研,结果你会发现——你永远不知道,你将会走上哪个路. 长远的目标是好的,但有些时候身不由己也迫不得已!做好自己的当下就是好的. 不论搞什么,总会遇到各种各样的问题,以 ...

  4. mysql5.5碰到的type= MyISAM报错问题

    最近把mysql升级到5.5版本,发现type= MyISAM报错,网上查了一下原来MYSQL5.5.x 版本 不支持 TYPE=MyISAM  这样的语句了!!! MYSQL语句写法 TYPE=My ...

  5. 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 - ...

  6. std::unique_ptr使用incomplete type的报错分析和解决

    Pimpl(Pointer to implementation)很多同学都不陌生,但是从原始指针升级到C++11的独占指针std::unique_ptr时,会遇到一个incomplete type的报 ...

  7. TypeError: value.getTime is not a function (elementUI报错转载 )

    "TypeError: value.getTime is not a function" 2018年07月02日 16:41:24 leeleejoker 阅读数:2091 标签: ...

  8. ie8下修改input的type属性报错

    摘要: 现在有一个需求如图所示,当用户勾选显示明文复选框时,要以明文显示用户输入的密码,去掉勾选时要变回密文,刚开始想到的就是修改输入框的type来决定显示明文还是密文,使用jQuery的attr来做 ...

  9. Mac下Android绘制点9格式png以及解决IllegalArgumentException: Unknown image type 0报错

    在Mac下的AndroidStudio中,右键png图片选择“create 9-patch-file”时会报错:IllegalArgumentException: Unknown image type ...

随机推荐

  1. 转: 在CentOS 6.X 上面安装 Python 2.7.X

    转:https://ruiaylin.github.io/2014/12/12/python%20update/ 评注: yum -y update //这个更新太坑了,1120更新包...想死的心都 ...

  2. Hive 外部表 分区表

      之前主要研究oracle与mysql,认为hive事实上就是一种数据仓库的框架,也没有太多另类,所以主要精力都在研究hadoop.hbase,sqoop,mahout,近期略微用心看了下hive. ...

  3. SolidEdge如何在零件上写字 如何绘制文字

    在草图状态下,插入-文字轮廓   可以按这两个按钮调节文字的大小和位置   之后你可以通过长出或除料把文字凸起或者凹下去   如果你要制作路径文字(比如环形文字),则先绘制一条圆或一段圆弧,并设为构造 ...

  4. zoj How Many Shortest Path

    How Many Shortest Path 题目: 给出一张图,求解最短路有几条.处理特别BT.还有就是要特别处理map[i][i] = 0,数据有不等于0的情况! 竟然脑残到了些错floyd! ! ...

  5. iOS开发核心语言Objective C —— 全部知识点总结

    本分享是面向有意向从事iOS开发的伙伴及苹果产品的发烧友,亦或是已经从事了iOS的开发人员,想进一步提升者.假设您对iOS开发有极高的兴趣,能够与我一起探讨iOS开发.一起学习,共同进步.假设您是零基 ...

  6. HDU 1040 As Easy As A+B [补]

    今天去老校区找她,不想带电脑了,所以没时间A题了 /*******************************************************************/ As Ea ...

  7. [转载]C函数的实现(strcpy,atoi,atof,itoa,reverse)

    在笔试面试中经常会遇到让你实现C语言中的一些函数比如strcpy,atoi等 1. atoi 把字符串s转换成数字 int Atoi( char *s ) { , i = ; ; ; isspace( ...

  8. 把握linux内核设计思想(五):下半部机制之工作队列及几种机制的选择

    [版权声明:尊重原创.转载请保留出处:blog.csdn.net/shallnet,文章仅供学习交流,请勿用于商业用途]         工作队列是下半部的第二种将工作推后运行形式.和软中断.task ...

  9. 李洪强iOS开发之-修改状态栏的字体的颜色

    李洪强iOS开发之-修改状态栏的字体的颜色 修改的效果: -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [ ...

  10. EF(Entity Framework)通用DBHelper通用类,增删改查以及列表

    其中 通用类名:DBhelper 实体类:UserInfo 1 //新增 2 DBHelper<UserInfo> dbhelper = new DBHelper<UserInfo& ...