开发者

iPhone OpenGL ES app killed on iPad when using "2x" button

开发者 https://www.devze.com 2023-03-05 04:20 出处:网络
Hey, I got kind of a weird issue here. I have an iPhone-only OpenGL ES app which runs fine on all iPhone and iPod touch models supported.

Hey, I got kind of a weird issue here.

I have an iPhone-only OpenGL ES app which runs fine on all iPhone and iPod touch models supported.

When running on the iPad, it runs on an iPhone-sized window as expected, and pressing the "2x" button once scales up the window to twice the size, as expected, and the app continues to run without problems.

But if the user taps the "2x" button 3 or 4 times quickly, the app is killed with the Program received signal: "0" message (which, from what I understand, means the OS killed my app for using too much memory开发者_开发技巧, is that right?)

What I really do not understand is what in my app could possibly be using up more memory when the iPad scales the window up and down? As far as I know there's not even any way for my app to tell if and when the iPad is doing that. I don't know if the fact I'm using OpenGL ES is related or not, but that issue doesn't happen on any of the Cocoa Touch apps I have - though it also doesn't happen on the other two OpenGL ES apps I have. And this app does use more memory than any of the other ones.

Anyone ever had or even heard of this problem? Googling gave me nothing.


Since no one has posted with a direct answer (your situation might be a little vague), I have a suggestion for how to move forward and gather more information on what might be causing your problem.

Check out the Instruments in Xcode which can identify memory leaks: Instruments User Guide

Or for an even friendlier introduction, here's a video that address performance issues, including memory leaks (and how to find them). iOS Performance Optimization Video


Just adding this so there's some kind of an answer here...

I never figured out what the hell was going on with the 2x button.

The way I fixed it back then was to optimize memory usage as much as I could, lazy-load all that I could and unload again when not in use.
Weird that it never complains about memory when running on any of the supported iPhone or iPod touch models, even the older ones, but it got killed on the iPad ONLY when pressing the 2x button repeatedly and quickly... I guess that's always gonna be a mystery to me.

0

精彩评论

暂无评论...
验证码 换一张
取 消