私はこれにこだわっています:
アプリにデータを入力する必要があります。
プロモーションを初めて使用しています....
ProMotion がなければ、init メソッドでデータを取得するために使用します
今私のコードは以下のようになります:
class Parties < ProMotion::TableScreen
attr_accessor :_cells
@news = []
include MyUiModules
title 'Yazarlar'
refreshable callback: :on_refresh,
pull_message: "Pull to refresh",
refreshing: "Refreshing data…",
updated_format: "Last updated at %s",
updated_time_format: "%l:%M %p"
def on_refresh
#MyItems.pull_from_server do |items|
#@my_items = items
end_refreshing
#update_table_data
# end
end
def table_data
_cells = []
[{
title: nil,
cells: create_cells(_cells)
}]
end
def will_appear
Barbutton.create_bar(self)
set_attributes self.view, {
backgroundColor: hex_color("DBDBDB")
}
end
def go_to_next
App.delegate.slide_menu.show_menu
end
def create_cells(_cells)
BW::HTTP.get(URL) do |response|
json = BW::JSON.parse response.body.to_str
for line in json
_cells << { title: line["val_for_title"]}
end
end
_cells
end
end
残念ながら、これは空の配列を返しますが、それを解決する方法がわかりません。助けてくれてありがとう