If I put any code (eternal cycle like while(1)
or sleep(xxxxx)
) that potentially can hang out main thread:
- (void)viewDidLoad
{
[super viewDidLoad];
while (1) {
}
//[NSThread sleepForTimeInterval:10000];
}
I'm getting SIGABORT just after launch in approximately 50% of launches.
What is going on?
Though, if program is launched it is never (for at least 10 minutes) terminated as it should according to Synchronous Networking On The Main Thread. What about watchdog
that should check application responsiveness and terminate the one that got stuck?
I presume that there's a question about this here but it doesn't contain meaningful answer though.
Tested both on simulator and device. The startup crash appears only on sim. Though the program is terminated neither on device nor on sim.
So there are actually two questions: 1. What about watchdog? 2. What is this startup crash on sim?
P.S. Sorry for my English I hope you've got what I mean.You're welcome to edit my post.