title: Reg: modifying layer that is being finalized....... [CALayer frame]: message sent to deallocated instance 0xe43c520
body: <p>I am stuck with a very strange issue. I hope that many of you can provide me input to solve this.
  My application breaks quite often, but I am not able to get the exact scenario.</p>
  
  <p>In Log I get  following </p>
  
  <pre><code>2011-02-10 16:22:12.914 RCA-iOS[4132:8327] modifying layer that is being finalized - 0xe43c520
  2011-02-10 16:22:13.253 RCA-iOS[4132:207] modifying layer that is being finalized - 0xe43c520
  2011-02-10 16:22:13.270 RCA-iOS[4132:207] modifying layer that is being finalized - 0xe43c520
  2011-02-10 16:22:13.270 RCA-iOS[4132:207] modifying layer that is being finalized - 0xe43c520
  2011-02-10 16:22:13.272 RCA-iOS[4132:207] *** -[CALayer frame]: message sent to deallocated instance 0xe43c520
  </code></pre>
  
  <p>Following is my Stack Trace. It breaks in main thread</p>
  
  <pre><code>#0  0x01978057 in ___forwarding___
  #1  0x01a07b42 in __forwarding_prep_1___
  #2  0x003c196a in -[UIView(Geometry) frame]
  #3  0x003f5ff4 in -[UINavigationBar _getTitleViewFrame:leftViewFrame:rightViewFrame:forViews:forItemAtIndex:]
  #4  0x003e5cab in -[UINavigationBar _getTitleViewFrame:leftViewFrame:rightViewFrame:forViews:]
  #5  0x003f0c06 in __-[UINavigationBar layoutSubviews]_block_invoke_1
  #6  0x003bdb5c in +[UIView(Animation) _performWithoutAnimation:]
  #7  0x003f76bb in -[UINavigationBar layoutSubviews]
  #8  0x00f59451 in -[CALayer layoutSublayers]
  #9  0x00f5917c in CALayerLayoutIfNeeded
  #10 0x00f5237c in CA::Context::commit_transaction
  #11 0x00f520d0 in CA::Transaction::commit
  #12 0x00f827d5 in CA::Transaction::observer_callback
  #13 0x019e7fbb in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
  #14 0x0197d0e7 in __CFRunLoopDoObservers
  #15 0x01945bd7 in __CFRunLoopRun
  #16 0x01945240 in CFRunLoopRunSpecific
  #17 0x01945161 in CFRunLoopRunInMode
  #18 0x02129268 in GSEventRunModal
  #19 0x0212932d in GSEventRun
  #20 0x0039e42e in UIApplicationMain
  #21 0x00001fd0 in main at main.m:14
  </code></pre>
  
  <p>And Following is the Instrument`s output for NSZombie object. This points to UIKit</p>
  
  <pre><code>#   Category    Event Type  RefCt   Timestamp   Address Size    Responsible Library Responsible Caller
  0   CALayer Malloc  1   25304068864 0x10837840  48  UIKit   -[UIView _createLayerWithFrame:]
  1   CALayer Zombie  -1  99780847872 0x10837840  0   UIKit   -[UIView(Geometry) frame]
  </code></pre>
  
  <p>Nothing point to the code. Has any one faced this kind of issue? If yes please let me know following <br/>
  <b>
  1) When we get "Modifying layer that is being finalized" breaking issue? <br/>
  2) Is is due to layer of UIView? For example (view.layer.cornerRadius) ?<br/>
  3) Stack Trace points to UINAvigationBar, is there any way to override the methods and tryout some thing?<br/>
  </b>
  <br/>
  Any help is appreciated. Thanks </p>