Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone app crashes at 2nd startup, when programatically loading a ViewController
    text
    copied!<p>App crashes with error "Thread 1: signal SIGKILL" when i start it up the second time in the simulator. The first time it will work perfectly, but if i close the app completely (double tapping the home button and closing the app) and start it up again - it crashes.</p> <p>I found others having the same problem (app crashes second time), but not of the same cause.</p> <p>I tried creating a new project to isolate the error, and it happens when i'm trying to programatically load a ViewController.</p> <p>I have made two simple classes: MainView and Loader (which is supposed to load MainView).</p> <p>In the viewDidAppear method in the Loader class i have the following code:</p> <pre><code>[super viewDidAppear:YES]; sleep(1); //Simulating to be doing stuff MainView* mainView = [self.storyboard instantiateViewControllerWithIdentifier:@"MainView"]; [self presentViewController:mainView animated:YES completion:nil]; </code></pre> <p>I get the following backtrace:</p> <pre><code>* thread #1: tid = 0x1f03, 0x9b5f5c22 libsystem_kernel.dylib`mach_msg_trap + 10, stop reason = signal SIGKILL frame #0: 0x9b5f5c22 libsystem_kernel.dylib`mach_msg_trap + 10 frame #1: 0x9b5f51f6 libsystem_kernel.dylib`mach_msg + 70 frame #2: 0x0139b10a CoreFoundation`__CFRunLoopServiceMachPort + 186 frame #3: 0x012fe550 CoreFoundation`__CFRunLoopRun + 1312 frame #4: 0x012fdd84 CoreFoundation`CFRunLoopRunSpecific + 212 frame #5: 0x012fdc9b CoreFoundation`CFRunLoopRunInMode + 123 frame #6: 0x012b07d8 GraphicsServices`GSEventRunModal + 190 frame #7: 0x012b088a GraphicsServices`GSEventRun + 103 frame #8: 0x00011626 UIKit`UIApplicationMain + 1163 frame #9: 0x00001c4d progLoadingTest`main + 141 at main.m:16 frame #0: 0x9b5f5c22 libsystem_kernel.dylib`mach_msg_trap + 10 frame #1: 0x9b5f51f6 libsystem_kernel.dylib`mach_msg + 70 frame #2: 0x0139b10a CoreFoundation`__CFRunLoopServiceMachPort + 186 frame #3: 0x012fe550 CoreFoundation`__CFRunLoopRun + 1312 frame #4: 0x012fdd84 CoreFoundation`CFRunLoopRunSpecific + 212 frame #5: 0x012fdc9b CoreFoundation`CFRunLoopRunInMode + 123 frame #6: 0x012b07d8 GraphicsServices`GSEventRunModal + 190 frame #7: 0x012b088a GraphicsServices`GSEventRun + 103 frame #8: 0x00011626 UIKit`UIApplicationMain + 1163 frame #9: 0x00001c4d progLoadingTest`main + 141 at main.m:16 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload