2013-06-30 1 views
0

작업중인 레이크를 시도 할 때 다음과 같은 오류가 발생합니다. 그 이유는 알 수 없습니다. 메시지는 내가 보낸 변수에 상관없이 발생합니다.setTranslucent 사용시 RubyMotion 오류

Objective-C stub for message `setTranslucent:' type `[email protected]:c' not precompiled. Make sure you properly link with the framework or library that defines this message 

다음은 내 app_delegate 파일입니다.

class AppDelegate 

def application(application, didFinishLaunchingWithOptions:launchOptions) 
    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) 
    tableView = StopsController.alloc.init 
    @navigationController = UINavigationController.alloc.initWithRootViewController(tableView) 
    @window.rootViewController = @navigationController 
    navigation_appearance 
    @window.makeKeyAndVisible 
    true 
end 


def navigation_appearance 
    @navigationController.navigationBar.setBackgroundImage UIImage.imageNamed('navbar_bg.png'), 
    forBarMetrics: UIBarMetricsDefault 
    @navigationController.navigationBar.setTranslucent(true) 
    @navigationController.navigationBar.setShadowImage UIImage.imageNamed('navbar_shadow.png') 
end 

end 

작동합니다 - 당신이 UINavigationBar의 인스턴스에 속성을 설정하지 않는 것 같은

class AppDelegate 

def application(application, didFinishLaunchingWithOptions:launchOptions) 
    navigation_appearance 
    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) 
    tableView = StopsController.alloc.init 
    @window.rootViewController = UINavigationController.alloc.initWithRootViewController(tableView) 
    @window.makeKeyAndVisible 
    true 
end 


def navigation_appearance 
    UINavigationBar.appearance.setBackgroundImage UIImage.imageNamed('navbar_bg.png'), 
    forBarMetrics: UIBarMetricsDefault 
    UINavigationBar.appearance.setTranslucent(true) 
    UINavigationBar.appearance.setShadowImage UIImage.imageNamed('navbar_shadow.png') 
end 

end 

답변

0

가 보이는!