我在尝试rake我正在进行的项目时遇到以下错误,我无法弄清楚原因。无论我发送什么变量,都会发生消息。
Objective-C stub for message `setTranslucent:' type `v@: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)
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 :(得分:0)
看起来你没有在UINavigationBar的实例上设置属性 -
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
应该有用!