views:

600

answers:

1

For iPhone developemnt, I have a CALayer with some image contents, when a button pushs, I want to remove the contens from the layer, and use this code:

[m_aCellLayer setContents:nil]

but I get EXC_BAD_ACCESS exception when running to line above, any Idea? Thanks

+1  A: 

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?

Ben Gottlieb
yes, you are right.
zhongshu