Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-[<CALayer: 0x5584190> display]: Ignoring bogus layer size

-[<CALayer: 0x5584190> display]: Ignoring bogus layer size (255211754908294243945860531626574872576.000000, 340282346638528859811704183484516925440.000000)

Can any one please tell me what's this warning about? The app is crashing on some devices showing this.

Any suggestion would be greatly helpful.

like image 624
ssc Avatar asked May 03 '10 10:05

ssc


3 Answers

I believe this is caused because the layer is too large and I expect this will cause issues buffering to an image for drawing.

I had this problem with a large UIView with relatively simple graphics and solved it by using a CATiledLayer

To do this, include the following in your UIView subclass to enable tiling:

+ (Class)layerClass {
    return [CATiledLayer class];
}
like image 137
K1w1Geek Avatar answered Oct 29 '22 16:10

K1w1Geek


I just encountered this error in a view controller that was being presented in a popover. The "ignoring bogus layer size" error was occurring when the popover was presented, and as a result a text field within the view controller did not render its text.

In my case, moving a textField.becomeFirstResponder() call from viewWillAppear to viewDidAppear resolved the issue.

like image 25
Eric Zelermyer Avatar answered Oct 29 '22 15:10

Eric Zelermyer


I spent a bit of time trying to find the answer to a similar question, I was getting:

[<CALayer: 0x37d540> display]: Ignoring bogus layer size (nan, nan)

but only on a device, not on the simulator. My problem was due to the fact that I was loading images out of the applicationCacheDirectory and it turns out the files had a mix of upper and lower cases in my project director. But in the Cache directory on device, they were all changed to lower case. Hope this helps someone in the future.

like image 41
user1435707 Avatar answered Oct 29 '22 16:10

user1435707