码迷,mamicode.com
首页 > 编程语言 > 详细

[Swift中错误]missing argument label 'greeting:' in call

时间:2016-02-16 23:18:25      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:

Swift 中出现这个问题:从第二个参数起,自动加上lable

func sayHello(name:String? ,greeting:String)->String
{
    let result = greeting + "," + (name ?? "Guest") + "!"
    return result
}


var nickname:String?
nickname = "yc"
//“Goodmorning前面应该增加greeting:”
print( sayHello("yc","Goodmoring") )

 

[Swift中错误]missing argument label 'greeting:' in call

标签:

原文地址:http://www.cnblogs.com/superorangecc/p/5193929.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!