问题是我试图通过使用genfstab命令生成有效的fstab输出,但是却收到错误消息,提示我作为参数提供的文件夹不是挂载点。
enum TableSection: Int {
case requests = 0, appointments, total
}
struct Category {
var clientName: String
var appType: String
var appDateTime: String
var status: String
var photo: UIImage?
}
var dataView = [[TableSection: Category]]()
var dataViewLoop = [Category]()
func SetData() {
for tableData in datas {
guard let data1 = Category(clientName: tableData.client_name ?? "",
appType: tableData.app_type ?? "",
appDateTime: tableData.app_date_time ?? "",
status: tableData.app_date_time ?? "",
photo: tableData.photo ?? nil) as Category? else {
fatalError("Unable to instantiate")
}
dataViewLoop += [data1]
}
dataView[.appointments] = dataViewLoop.filter({ $0.status == "confirmed" })
dataView[.requests] = dataViewLoop.filter({ $0.status == "request" })
// Cannot assign value of type '[TableViewController_Main.Category]' to type 'ArraySlice<[TableViewController_Main.Category]>'
我希望在i中可以接收到genfstab命令的输出,但是最重要的是,我需要sudo genfstab /命令可以正常工作。