title: Custom UISwitch Thumb Color with pattern image cause app crash (ARC)
body: <p>I would like to customise my UISwitch Thumb by setting an image to his method "setThumbTintColor" but this cause app crash. If I simply set the color like that :</p>
  
  <pre><code>[switch setThumbTintColor:[UIColor blackColor]];
  </code></pre>
  
  <p>there's not problem.</p>
  
  <p>But if I want to add an image like that :</p>
  
  <pre><code>    @property (nonatomic,strong) UIImage *imageThumb;
      @property (nonatomic,strong) UIColor *colorImageThumb;
      ...
      imageThumb = [UIImage imageNamed:@"myThumbImage.png"];
      colorImageThumb = [UIColor colorWithPatternImage:imageThumb];
      [switch setThumbTintColor:colorImageThumb];
  </code></pre>
  
  <p>The app crash as soon as the UISwitch is dealloc (I'm working with ARC but this is the error message).</p>
  
  <p>This thread seems to solve the problem but in an no-arc way. <a href="https://stackoverflow.com/questions/3095730/crashing-while-passing-uicolor-as-argument">Crashing while passing UIColor as argument</a></p>
  
  <p>Any idea?</p>
  
  <hr>
  
  <p>[EDIT]</p>
  
  <p>The image name is thumb_wood.png.</p>
  
  <p>The error message is an "EXC_BAD_ACCESS" error message.</p>
  
  <p>The last methods in the mainThread tree are :</p>
  
  <p>0 objc_msgSend</p>
  
  <p>4 - [UISwitch dealloc]</p>
  
  <p>5 - [MyUIViewController .cxx_destruct]</p>
  
  <p>etc... destruct chain</p>