-4
私は遠くのjsonファイルを読み込んでその結果を(グローバルスコープ)配列に入れるgetSemainesStages()関数を持っています。非同期Json配列からpickerViewを設定する
問題は、誰かが私に説明のように、それは非同期だということであり、私はこの配列がpickerViewデータソースを移入する必要があります。空
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return lesSemaines.count
}
配列はまだあり、かつ
func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return lesSemaines[row]
}
に同じどのように私は私のgetSemainesStages後に()関数が空であることを行うことができます。
は、だから私は、呼び出したとき?
を[1つのトピックを]複数の質問をしないでください(http://stackoverflow.com/questions/43184215/json-and-variable-scope)と[search](http://stackoverflow.com/a/3206956/1457385)を参照してください。 – shallowThought