有一个用ruby编写的应用程序,我需要运行。它在IOS11之前有效,但现在正在抛出错误。我安装了formotion以及所有合适的宝石和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
答案 0 :(得分:0)
程序中需要一些未包含在代码中的宝石作为需要安装的宝石。需要的宝石是:
bigdecimal (1.2.0)
bubble-wrap (1.3.0)
bundler (1.16.0)
formotion (1.5.1)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
motion-csv (0.0.2)
motion-require (0.0.7)
motion-testflight (1.5)
psych (2.0.0)
rake (10.1.0, 0.9.6)
rdoc (4.0.0)
sugarcube (1.1.0)
test-unit (2.0.0.0)