title: How to set a custom background image to tabbar?
body: <p>I am writing a Rubymotion app and I want to customize the TabBar. On NSScreencasts.com they explain how to do it in Objective-C but how can I transform the below code into Ruby?</p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame {
      self = [super initWithFrame:frame];
      if (self) {
          [self customize];        
      }
      return self;
  }
  
  - (id)initWithCoder:(NSCoder *)aDecoder {
      self = [super initWithCoder:aDecoder];
      if (self) {
          [self customize];
      }
      return self;
  }
  
  - (void)customize {
      UIImage *tabbarBg = [UIImage imageNamed:@"tabbar-background.png"];
      UIImage *tabBarSelected = [UIImage imageNamed:@"tabbar-background-pressed.png"];
      [self setBackgroundImage:tabbarBg];
      [self setSelectionIndicatorImage:tabBarSelected];
  }
  
  @end
  </code></pre>
  
  <p><em>This is my attempt:</em></p>
  
  <pre><code>class CustomTabbar &lt; UITabBarController
    def init
      super
      customize
      self
    end
  
    def customize
      tabbarBg = UIImage.imageNamed('tabbar.jpeg')
      self.setBackgroundImage = tabbarBg
    end
  end
  </code></pre>
  
  <p><em>But if I run it I get this error:</em></p>
  
  <pre><code>Terminating app due to uncaught exception 'NoMethodError', reason: 'custom_tabbar.rb:5:in `init': undefined method `setBackgroundImage=' for #&lt;CustomTabbar:0x8e31a70&gt; (NoMethodError)
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>*This is my app_delete file:*</p>
  
  <pre><code>class AppDelegate
    def application(application, didFinishLaunchingWithOptions:launchOptions)
      first_controller = FirstController.alloc.init
      second_controller = SecondController.alloc.init
  
      tabbar_controller = CustomTabbar.alloc.init
      tabbar_controller.viewControllers = [first_controller, second_controller]
  
      @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
      @window.rootViewController = tabbar_controller
      @window.makeKeyAndVisible
      true
    end
  end
  </code></pre>