0

I have seen other questions with a similar problem but mine looks a bit more serious. Xcode keeps crashing on me. I have no chance to even edit a single character in my code. It is a very simple playground file with some basic code, nothing fancy. I'm not able to do anything at all in the current state.

When Xcode crashes, I hit reopen and the same thing happens again.

Shruti Thombre
  • 989
  • 4
  • 11
  • 27
Shwethascar
  • 1,142
  • 9
  • 18
  • I have seen that post. I asked this question after following those steps. I didn't even have the simulator open so my situation is a little bit different. – Shwethascar Aug 31 '14 at 01:48

2 Answers2

2

Locate the playground file using the Finder, then right click and select 'Show Package Content'. Next select the swift file, right click and open it using your favorite text editor (which must not be Xcode :)).

Once there, either delete its content or surround your code with comments. In the latter case, you can reopen the playground file in Xcode and selectively uncomment code line by line to know which line(s) cause Xcode to crash.

I've verified that there some recurrent patterns in code that almost always makes Xcode to crash, for example, when I use 2 or more custom operators in the same statement. I don't know if it that happens for all custom operators, or it's my specific implementation - either case, I know that I have to avoid that combination. You should take note when you notice a particular combination of code regularly making Xcode crash, and try to avoid it by splitting into multiply lines when possible.

Antonio
  • 71,651
  • 11
  • 148
  • 165
0

Here's what I did to resolve it. I did reinstall Xcode a couple of times. It looks stable now but I'm not sure till when it would remain so. Looks like a bug to me. I will file it with Apple

Shwethascar
  • 1,142
  • 9
  • 18