我需要运行一个用 ruby 编写的应用程序。它在 IOS11 之前工作,但现在抛出错误。我已经安装了 formotion 以及所有适当的 gem 和 SDK。我无法让编译器识别出里面有一个 formotion gem。
我收到一个未捕获的异常“名称错误”,它说我试图在 formotion 类中实例化的变量是一个未初始化的常量。
任何有关此错误的帮助将不胜感激。
这是一些代码,错误指向row.text_field.resignFirstResponder
module RowType
class PickerWithDoneRow < PickerRow
include RowType::ItemsMapper
def after_build(cell)
super
keyboardDoneButtonView = UIToolbar.new
keyboardDoneButtonView.barStyle = UIBarStyleBlack
keyboardDoneButtonView.tintColor = "#000".uicolor
keyboardDoneButtonView.translucent = false
keyboardDoneButtonView.sizeToFit
# keyboardDoneButtonView.barTintColor = "#BFC3C8".uicolor
keyboardDoneButtonView.barTintColor = "#EFEFF4".uicolor
doneButton = UIBarButtonItem.alloc.initWithTitle("Done", style:UIBarButtonItemStylePlain, target:self, action: 'picker_done_clicked')
spacer1 = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemFlexibleSpace, target:self, action: nil)
spacer = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemFlexibleSpace, target:self, action: nil)
keyboardDoneButtonView.setItems([spacer, spacer1, doneButton])
row.text_field.inputAccessoryView = keyboardDoneButtonView
end
def picker_done_clicked
row.text_field.resignFirstResponder
end
end
end