Xcode: EXC_BREAKPOINT (EXC_ARM_BREAKPOINT, subcode=0xe7ffdefe)

前端 未结 3 1742
一生所求
一生所求 2020-12-17 16:00

I\'m getting an EXC_BREAKPOINT (EXC_ARM_BREAKPOINT, subcode=0xe7ffdefe) error while running my app on a iOS7 device. The thing is, it runs smoothly on iOS7 simulator.

<
3条回答
  •  抹茶落季
    2020-12-17 16:32

    I ran across this issue today when testing some Swift code against an old iPad 2 (I think it's an iPad 2 -- it's model MD368LL/A), running iOS 8.1.3. It turned out that the problem existed everywhere that I was calling something like:

    Int(arc4random() % )
    

    This worked fine on later iPads, iPhone5S, iPhone6, etc. Fixed by changing code to:

    Int(UInt32(arc4random()) % UInt32())
    

    I think it was a register overflow on the older hardware.

提交回复
热议问题