开发者

CoreAnimation stack going crazy

开发者 https://www.devze.com 2023-04-04 06:34 出处:网络
I\'ve been asked to help fix a bug for a client, who is an inexperienced developer. However, I\'m absolutely stumped by this one.

I've been asked to help fix a bug for a client, who is an inexperienced developer. However, I'm absolutely stumped by this one.

The problem is that after 开发者_如何学Ca string of opening and closing a view controller, which is being pushed onto a navigation controller, all of the subviews will disappear (including the navigation bar items) and show straight through to the window. After this happens, I can still press the buttons on the navigation bar, but they will immediately disappear on touch-up, and restoring a stable UI state is impossible without a quit & relaunch. Another obscure side effect is that after closing the app, Springboard will flash as I swipe between screens. My initial thoughts were that this was a memory issue (e.g. subviews getting released on memory warning), but I have since cleaned all the leaks & checked all the viewDidLoad/viewDidUnload handling of outlets and the problem is still happening. So now I think that with the Springboard effect, that the code is somehow messing up the state of core animation entirely.

Has anyone seen anything like this before? Or have any idea how it would be possible to make this much of a mess? I would attach some screenshots, but trying to take a screenshot with the phone when the app is in this state causes a system crash.


I've not experienced this, but maybe a memory warning is eating some of your views?

I know that iOS is free to unload view controllers that aren't visible.

I'd stick a breakpoint in viewdidunload or similar and see if that triggers.


As it turned out, this bug was caused by a UIView being deallocated while it had a superview.

0

精彩评论

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

关注公众号