iOS Crash

Can anybody decode this? I’m using images for buttons by overlaying the image with an iOS button. The crash occurs sporadically and randomly when the buttons are pushed. I have this code in the App.Unhandledexception Event Handler but it doesn’t work either.

Dim mynewView as New HomeView App.CurrentScreen.Content=mynewView

Copy of Device Log:

Note Item 4: 4 Boat Minder 0x0000000102b628b0 UnhandledException(RuntimeObject*) (

Date/Time: 2017-08-27 16:56:06.7103 -0400
Launch Time: 2017-08-27 15:21:24.9236 -0400
OS Version: iPhone OS 10.3.3 (14G60)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0

Filtered syslog:
None found

Thread 0 name: Dispatch queue:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000181ac1014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000181b8b264 pthread_kill + 112
2 libsystem_c.dylib 0x0000000181a359c4 abort + 140
3 libsystem_c.dylib 0x0000000181a0a53c basename_r + 0
4 Boat Minder 0x0000000102b628b0 UnhandledException(RuntimeObject*) (
5 Boat Minder 0x0000000102b65b04 -[XOJButtonExtraInfo touchUpInside:] (
6 UIKit 0x0000000188c2dc54 -[UIApplication sendAction:to:from:forEvent:] + 96
7 UIKit 0x0000000188c2dbd4 -[UIControl sendAction:to:forEvent:] + 80
8 UIKit 0x0000000188c18148 -[UIControl _sendActionsForEvents:withEvent:] + 440
9 UIKit 0x0000000188c2d4b8 -[UIControl touchesEnded:withEvent:] + 576
10 UIKit 0x0000000188c2cfd4 -[UIWindow _sendTouchesForEvent:] + 2480
11 UIKit 0x0000000188c2836c -[UIWindow sendEvent:] + 3192
12 UIKit 0x0000000188bf8f80 -[UIApplication sendEvent:] + 340
13 UIKit 0x00000001893f2a20 __dispatchPreprocessedEventFromEventQueue + 2400
14 UIKit 0x00000001893ed17c __handleEventQueue + 4268
15 UIKit 0x00000001893ed5a8 __handleHIDEventFetcherDrain + 148
16 CoreFoundation 0x0000000182a7542c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
17 CoreFoundation 0x0000000182a74d9c __CFRunLoopDoSources0 + 540
18 CoreFoundation 0x0000000182a729a8 __CFRunLoopRun + 744
19 CoreFoundation 0x00000001829a2da4 CFRunLoopRunSpecific + 424
20 GraphicsServices 0x000000018440d074 GSEventRunModal + 100
21 UIKit 0x0000000188c5dc9c UIApplicationMain + 208
22 Boat Minder 0x0000000102b63270 runIOSMainLoop() (
23 Boat Minder 0x0000000100029688 xojo._RuntimeRun + 36
24 Boat Minder 0x0000000102a6e294 _Main + 392
25 Boat Minder 0x0000000102a6d810 main + 96
26 libdyld.dylib 0x00000001819b159c start + 4

Put code in he UnhandledException event and log what happened.

If your app is shutdown by Watchdog then UnhandledException won’t fire. We really need a way to symbolicate the crash log to work out where crashes occur but I don’t know of a way that currently works with Xojo apps.

You could have code in your touchup event that reference to a bad Ptr (a Ptr that you think exists but it doesn’t)

Thank you all. I believe it’s a watchdog shutdown. I have some threads running in the background which may be the problem. I’m reluctant to use a catch try because it may mask a coding error.

If your app takes too long to do something and the UI becomes unresponsive — which can happen if you have too many threads running — then Watchdog may shut you down. Another scenario that can invite Watchdog’s unwanted attention is ignoring low memory messages (i.e. not releasing some memory when this message is sent).

I think it’s good practice to use try/catch so long as you are always catching something specific and not just catching and then ignoring an error. Also write out the detail to the DebugLog at the very least and/or even your own logging system to make it easier for users to share with you.

Crash Redux

Still getting the UnhandledException crash. The following is a constant in the crash report:

16 CoreFoundation 0x0000000182a7542c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24

Also using a Try / Catch doesn’t work whether it’s specific to UnhandledException or a non specific Try / Catch.

Works fine in the simulator but not on the device. Troubleshooting requires building and testing on the device but my build time is at least an hour and a half or more which when changing just one line of code shuts me down while I wait for the build. The App is at 118MB already. Any ideas on how to get the build time to a reasonable level would be appreciated.

That’s a big app! Do you have a lot of assets, eg images or video files, included?

It’s mostly code. The App uses 10 SQLite databases which are empty of data at build time. Image assets number about 20 which are smallish png files for button images.

Also, this may be a factor. My device is a 5s iPhone but I’m using the 6s simulator. The excessive build times are keeping me from trying different combinations. Two builds pretty much shut me down for the day and sometimes the build fails and then 3 hours are gone. The build stalls at “linking” whatever that means. I’m wondering if that’s the dSYM file and whether there might be a way to build without it. This App is beyond my expertise in Xcode which allows you run directly on the device as the simulator.

10 Databases???
why not TABLES inside of ONE database?

Mostly organization Dave. One database would need over 100 tables, very hard to keep track of, plus one of the features in the App creates databases on the fly. I tried a single database when I first started to develop the App and lost track of my tables very quickly. I believe I then embarked on the path of unintended consequences. I think one of my problems is that my database open code is in the View Open and I use

Dim mynewView as New View2 App.CurrentScreen.Content=mynewView
to change views which then opens the database over and over when I change views. This crashes the App after about 25 or so view changes depending on the size of the database. I don’t want to use a push since I want the view to appear rather than slide in. As I say, the excessive build time, prevents me from changing things around a little at a time for troubleshooting. I’ve already spent 6 months on this and would love to find a fix without redoing the whole thing but I’m afraid that may be necessary. I’m of the opinion that what is going to be required is opening the databases in in App.Open, writing all the data to variables and loading the fields in each view from the variables. What further complicates this is that I’m using custom table cells which requires writing the data to a data source for which I’m using arrays. I feel like I’m lost in the maze out of “The Shining”. If it ran on the device like it does on the simulator then it would be ready to publish. You helped me out quite a bit back when I was developing my first Windows App in RealBasic. Thanks Dave.

Werner, perhaps its time to step back and think about your process and your goals.
I have routinely worked with databases with literally 1000s of tables (not in Xojo, but the point is still valid)
not to mention that each DB connection increases overhead… that is 100 DB takes 100x more resources than 1 does… and under iOS your resource may be more constrained than on a Desktop. As a matter of fact, it is a known fact that some apps will run just fine in the Simulator, and fail on the device. The simulator has access to the full memory of the desktop which might exceed that of a real device, and the simulator can be MUCH faster than a real device (depending on the desktop and the device of course, but a 5s is not know to be a speed demon,)

And the fact that it takes 90+ minutes to build leads me to believe there are other issues at work here.

I do not use Xojo for iOS (its an immature overpriced product in my opinion), and do all my iOS work in Swift… which does have its own challenges… but that being said… I have NEVER had a build take more than a minute…

Thanks Dave. I think this is what I needed to hear, not what I wanted to hear. I’m going to rework the whole thing in manageable (and quickly buildable) modules and then combine them when all tests correctly. I would love to do this in Xcode but the learning curve at this point is daunting. I’m of an age where I don’t buy green bananas and I would like to get this to market before my kids have to finish it.

Werner… I’m 62… and always buy green bananas (I hate when they turn yellow) :smiley:

and SWIFT (while different) really doesn’t have that steep a learning curve, you just have to be open-minded to that fact that it is not Xojo, Delphi, Basic but it is still “similar” in syntax…

LOL. I’ve got you beat by 5 years, but still loving to learn. Thanks for putting me on the right path. You’re living in my second favorite place. Used to lay over in San Diego all the time back when I was flying for Continental Airlines.

Make that 6 years. Forgot I just had a birthday.