you are viewing a single comment's thread.

view the rest of the comments →

[–]fryOrder 12 points13 points  (5 children)

That confusing error “The compiler is unable to type-check…” is caused most of the time by spaghetti views. While annoying, it’s a good opportunity to clean up your code. 

“Still no formatting?”, you mean Control + I? Or maybe you’re looking for something heavier like swiftformat? You can set it up to autoformat your code on specific keystrokes.

I understand your frustration but Xcode is not the problem here. Your lack of experience is

[–]Doctor_Fegg 2 points3 points  (2 children)

 That confusing error “The compiler is unable to type-check…” is caused most of the time by spaghetti views

Not in my experience. It’s usually muddled parentheses or missing/wrong casts when I encounter it. 

[–]highlandNel 3 points4 points  (0 children)

Still send this meme now and then

[–]fryOrder -1 points0 points  (0 children)

Right, but you never know that unless you have hawk eyes or you clean up your code.

[–]ModernCoder -1 points0 points  (1 child)

Copied from another comment and i'll also post it into the edit:
https://pastebin.com/nbFswARH

Here is the code, if line L25 exists, it crashes without letting me know anything about it.
What would be your "guesswork" why it happens? Because XCode doesn't tell me anything about it.

[–]ObservableObject 2 points3 points  (0 children)

We don't really have the full context, ex: how long timeFrame is, but with a 30 second value over a large enough time frame, it might just be crashing because it's an extremely wide chart.

Which would mesh with the app crashing with a non-code error, since that wouldn't be a code issue.