10000-Animations icon indicating copy to clipboard operation
10000-Animations copied to clipboard

列表未显示任何内容

Open youngerbyte opened this issue 8 years ago • 0 comments

本人对swift不太熟悉,不知道为什么列表展示为空,只是定位代码出问题的行数,希望作者看一下,xcode8.1 iphone 10.1.1 func setupData() { guard let path = Const.jsonPath, let data = jsonToArray(path: path) else { return } for dict in data { guard let anyClass = st.classFromString(name: dict["type"] ?? "") else { continue // !!!每次都执行这里导致dataSource为空!!! }

        let title: String = dict["title"] ?? ""
        let status: Bool = dict["status"] ?? "" == "1"
        let description: String = dict["description"] ?? ""
        let action: ActionType = ActionType(rawValue: dict["action"] ?? "push")!
        let model = Model(title: title, type: anyClass, status: status, description: description, action: action)
        dataSource.append(model)
    }
}

youngerbyte avatar Dec 22 '16 01:12 youngerbyte