title: Main Thread Crash Using Key Value Observing And ECSlidingView Library
body: <p>I am using NSKeyValueChange to refresh images appeared in the tableview after getting them from the web service.</p>
  
  <pre><code>- (void)observeValueForKeyPath:(NSString *)keyPath
                ofObject:(id)object
                  change:(NSDictionary *)change
                 context:(void *)context {
  
  if ([keyPath isEqual:@"thumbnail"]) {
    UIImage* newImage = [change objectForKey:NSKeyValueChangeNewKey];
    if (newImage != (id)[NSNull null]) {
      self.thumbContainer.image = newImage;
      [self.thumbContainer setNeedsLayout];
    }
  }
  
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>[item addObserver:cell forKeyPath:@"thumbnail" options:NSKeyValueObservingOptionNew context:NULL];
  </code></pre>
  
  <p>It was all working fine until i added the whole navigation inside a third party library named ECSlidingViewController to have a left side navigation similar to Facebook and Sparrow Mail app.</p>
  
  <p>Now my app is getting crashed and following is the image i get when i try to load more cells in the tableview when it gets to the bottom. </p>
  
  <p><img src="https://i.stack.imgur.com/iE4VW.jpg" alt="enter image description here"></p>
  
  <p>As you can see in the image above, it is not enough for me to troubleshoot where exactly the problem is. I have tried checking similar problems on StackOverflow related to Main Thread crashes but they didn't help me.</p>
  
  <p>Can somebody please look into it and where could the problem is. Thanks in advance.</p>
  
  <p>UPDATE: I am able to run the program but when i scroll down to reveal more cells, this issue  cause the program to crash.</p>