4

With second line something wrong, what?

let modelURL = NSBundle.mainBundle().URLForResource("xxx", withExtension: "momd");
let managedObjectModel = NSManagedObjectModel.init(contentsOfURL: modelURL)

enter image description here

János
  • 32,867
  • 38
  • 193
  • 353

5 Answers5

4

In my case I had imported missing files in bridged header. After I deleted it the error notification gone.

Shmidt
  • 16,436
  • 18
  • 88
  • 136
2

the issue is the ";" letter end of the first line, I removed it, and now it works, no popup anymore, that was an interesting side effect

János
  • 32,867
  • 38
  • 193
  • 353
1

In my case, I created about 6+ swift files for one or two targets and SourceKit Service Failure errors occurred. I found I was importing Frameworks that I was not using. So I deleted many of the import lines across the .swift files. For me, it was helpful; I am getting (much) less error.

Hope this helps.

KW

0

I run across this every once in a while too. As near as I can tell, it's an issue that occurs when you try to do something that the type checker doesn't think is valid - I run across it a lot when writing for-in loops. You should file a bug report, detailing what code, exactly, produces the error.

For now, you'll probably have to play with it until you find a combination that doesn't make the realtime-compiler angry.

Undo
  • 25,519
  • 37
  • 106
  • 129
  • I crash the SourceKit about every two minutes. I don't know *the thing* that's causing it, because it seems *everything* causes it. One sure-fire way is to update a line of code from one type to another - so for instance if you had a line of code appending an array of Items and you change the base type to be an array of Things, boom. But that's only one of many, many crashes I've see and most of them I can't determine. – Maury Markowitz Oct 28 '14 at 11:30
  • @Maury That's interesting, for me it seems to have gotten much stabler. I'm only crashing it maybe three times a day now. – Undo Oct 28 '14 at 14:11
  • That's the even weirder part. Today it's crashing all the time, in some cases only seconds apart. Yesterday I got maybe five crashes total, doing the same sort of things. – Maury Markowitz Oct 28 '14 at 16:02
0

Set the target to 7.1 fix my issue. Hope this helps you.

Update: I have a working solution here, works for me:

Error Xcode 6 --> Error SourceKit terminated. Editor functionality temporarily limited

Hope can help

Community
  • 1
  • 1
Meng Zhang
  • 191
  • 2
  • 5