0
import Foundation


var currentTime = NSDate()
println("It is currently", currentTime)

This Swift code is very simple and should work, correct? Why am i receiving an error that says "SourceKitService terminated - editor functionality currently limited" Am I doing something wrong or is it the beta's fault?

ejLev
  • 3,061
  • 2
  • 14
  • 17
  • 1
    It should be like: `println("It is currently \(currentTime)")` – Jack Jun 17 '14 at 18:16
  • Or...(I think that first one might be wrong), `println("It is currently" + currentTime.description)` – Jack Jun 17 '14 at 18:18
  • Regardless of whether you're doing something wrong, SourceKitService shouldn't be crashing. You can file a bug report at bugreport.apple.com to bring it to the Swift team's attention. – Catfish_Man Jun 24 '14 at 01:54

1 Answers1

2

You would use string interpolation as Jack Wu suggested in the first comment:

println("It is currently \(currentTime)")

The println primary function does not take multiple arguments. You could also use

println(currentTime)

However, the fact that your first (syntax error) attempt causes Xcode 6 to crash (at least it does for me) is certainly a bug. You should just get an issue reported.

JefferyRPrice
  • 895
  • 5
  • 17
  • Thanx! Switching to string interpolation worked. I'm actually a new developer and I only know basic objective-c. Now I'm switching to swift so stuff are still confused. – ejLev Jun 17 '14 at 18:36