[英]'NSString!' is not convertible to 'String'; did you mean to use 'as!' to force downcast?
Code: 码:
var strCategIds = ""
for(var i = 0; i < arrCateName.count; i++){
var prCate:PropCategory = arrCateName.objectAtIndex(i) as! PropCategory
if(prCate.bSelected == true){
strCategIds = strCategIds + prCate.strCategoryId as! String!
}
}
What is this error meaning?I have spent lot of time on it.but no success.any help will be appreciated.thanks in advance 这个错误是什么意思?我花了很多时间在上面,但没有成功,任何帮助将不胜感激。
strCategIds + prCate.strCategoryId as! String!
is compiled as 被编译为
(strCategIds + prCate.strCategoryId) as! String!
Instead, I think you should: 相反,我认为您应该:
strCategIds + (prCate.strCategoryId as! String)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.