This initialiser will cause an error complaining that "with" is implied for the first parameter of an initialiser; did you mean name?
init(withName: String){
}
I'm not sure what this means, if it provides automagically the withName
external parameter name if I call it name or what...
If I change it to
init(name: String){
}
any attempt at calling it init(with: "joe")
or init(withName: "Joe")
will fail. So I have no idea what the error message is telling me and how I can declare it so I call it init(withName: "joe")
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…