zhongshu
zhongshu

Reputation: 7878

How to remove contents from CALayer?

I have a CALayer with some image contents. When a button touched, I want to remove the contents from the layer, and I use this code:

[m_aCellLayer setContents:nil]

but I get EXC_BAD_ACCESS exception when executing above line. Do you have any idea why?

Upvotes: 0

Views: 1931

Answers (1)

Ben Gottlieb
Ben Gottlieb

Reputation: 85532

Just the obvious stuff: is m_aCellLayer valid when you make this call, or has it been deallocated? Did you try NSLog()ing it just before you make the call?

Upvotes: 1

Related Questions