OK. I am beside myself here.
I’ve had an iOS app that has been in the store for a couple years now. I recently started working on some updates to it and one of my business partners who’s been testing it says it’s been crashing. It was working fine on my end and also on my iPad Pro and my iPhones. No problem.
His crash reports in TestFlight didn’t tell me a lot. Something in the framework that was a NIL object exception or something like that. One of those vague Apple errors.
So I asked him to send me the copy of his database that I load into the app. So I tried to duplicate his setup. No crashes. Then I decide to try loading things onto my 7th generation iPad. Boom! Crash happens. So now I go running it in the debugger on this iPad. Trying to catch exceptions - nothing. The app just crashes. Searching through the logs, I did fine this one:
3836 error 21:47:27.939944-0500 MediaSwitcher.debug CGSImageDataLock: Cannot allocate memory
Now, my app presents what is basically a grid of TV screens that are Container Controls with ImageView controls in them. You can see my app on the AppStore - MediaSwitcher for iOS. Now his system being loaded has a lot of TV Screens - about 150. The database I load is created with my desktop app and then transferred to the iOS app. He saved some rather large image files in his database to represent the icons to display for the screens. So I thought - maybe I am running out of memory by trying to load all these icons. So I tried scaling the images down to like 250x200 pixels. Nope still crashed. So I thought maybe instead of loading all these images at startup into 150 different objects each which basically is 150 different images that I’d load them only when I display them. Nope - still a crash.
Now I’m taking my images and after scaling them to like 200 x 250 pixels, I am storing every unique picture in a dictionary and pulling the picture when I need it. Nope still crashed and I checked just before crashing using a break point and I have about 5 picture objects in the dictionary.
Same exact crash - cannot allocate memory…
I have no clue. I can’t believe an 12" iPad Pro of the same vintage as my iPad 7th gen would have so much more memory. Same thing with my phones. I really have no clue here. It crashes after just loading a few images. It’s like in my loop, the memory is not being released each time through the loop.
To me this problem seems to have started with iOS 15.7 on the iPad. But if it was just iOS15.7, then I should have seen the crash on my iPad Pro but I don’t.
I am running Xojo 2022r3 now. I though maybe updating from r2 to r3 would fix it. Nope. Running Xcode 14.0.1 MacOS 12.6.1.
I am really clueless here. I hope someone can give me some insight…