swift - Why is it that when I hit the return key in xcode when editing code it will add/overwrite lines instead of simply adding a new line? -
i brand new ios development, not programming. i've started using xcode , finding aspects of simple code editing incredibly frustrating. here problem. start out following code:
func updatelabels() { targetlabel.text = string(targetvalue) scorelabel.text = string(score) roundlabel.text = string(round) }
i want edit this:
func updatelabels() { targetlabel.text = string(targetvalue) scorelabel.text = string(score) roundlabel.text = string(round) }
instead, depending on cursor when hit return key either this:
func updatelabels() { targetlabel.text = string(targetvalue) scorelabel.text = string(score) scorelabel.text = string(score) roundlabel.text = string(round) }
or this:
func updatelabels() { targetlabel.text = string(targetvalue) roundlabel.text = string(round) roundlabel.text = string(round) }
this causing lot of frustration me. want blank new line. not copy , paste line 3 line 4 while keeping line 3. not overwrite line 5 line 6 or 7 or 8 (whatever line chooses, doesn't have following line) still keeping line 6 or 7 or 8. new blank line need. why xcode make new line, , other times has odd behavior, , how can fix it?
i'm sure question has been asked before can't seem find right combination of words able locate answer. sorry repeat question
edit here editing problem i'm experiencing. read comment in following code
... } else if difference < 5 { title = "you had it!" if difference == 1 { points += 50 //the following line supposed closing curly brace "}" //instead types line when press "}" key title = "pretty good!" } else if difference > 5 { . . .
typing following in terminal fixed problem:
defaults delete com.apple.dt.xcode
this restores xcode state of first launch.
Comments
Post a Comment