我是Swift的新手,正在尝试学习初始化的概念。我在下面创建了一个SurveyQuestion实例(即cheeseQuestion)。
但是,在创建之后,我想要更改' var text:String'到#34;你喜欢什么样的奶酪"?请有人请告诉我如何做到这一点?
class SurveyQuestion{
var text: String
var response: String?
init(text: String){
self.text = text;
}
func ask(){
print(text)
}
}
let cheeseQuestion = SurveyQuestion(text: "do you like cheese?")
cheeseQuestion.ask()
cheeseQuestion.response = "yes, i do like cheese"
答案 0 :(得分:1)
define(["jquery", "jqueryMobile"], function($) {
//jQuery and jQuery Mobile have been loaded.
$(function() {
// Do stuff with jQuery and jQuery Mobile
});
});
没什么特别的。