App Crashes Only On Testflight Build

前端 未结 11 2151
北海茫月
北海茫月 2020-12-13 03:56

I have created an app on swift and tested it extensively using iPhone 6, iPhone 6 plus and iPhone 5 devices and all the simulators offered in Xcode. The app runs fine and do

11条回答
  •  不思量自难忘°
    2020-12-13 04:23

    If anyone else is having the same problem, here's what my fix was:

    I finally got the problem down to a loop with a if statement, akin to this -

    while(condition)
    {
        if (check)
        {
            code!
        }
        //There was no code here
    }
    

    Notice that there's no code at the end of the loop (where the comment is). Once I added a random bit of code (in this case, incrementing a variable for output), the problem stopped.

    while(condition)
    {
        if (check)
        {
            code!
        }
        i += 1;
        output statement
    }
    

    I think this has to be a compiler error, or else my "fix" shouldn't be a fix at all. But here it is in case it helps anyone else!

提交回复
热议问题