Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate iOS app crashing in Xcode? [closed]

Tags:

xcode

iphone

Is there a way to simulate an app crashing? Purpose being I want to check that data is gracefully saved & retained if somehow app randomly crashes on an actual user device.

like image 784
Halordain Avatar asked Dec 02 '22 16:12

Halordain


2 Answers

Ooh, there is a lot of ways crashing your app) For example, index out of range exception:

NSArray *array = @[];
array[1];

Or in short form:

@[][1];
like image 112
Alexander Tkachenko Avatar answered Dec 06 '22 23:12

Alexander Tkachenko


You can press Stop when running in debug mode..

like image 26
Erika Electra Avatar answered Dec 07 '22 01:12

Erika Electra