Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 无法分配类型为';数据模型&x27;输入';字符串?';迅速地_Swift_Xcode - Fatal编程技术网

Swift 无法分配类型为';数据模型&x27;输入';字符串?';迅速地

Swift 无法分配类型为';数据模型&x27;输入';字符串?';迅速地,swift,xcode,Swift,Xcode,类ViewController:UIViewController、UITableViewDataSource、UITableViewDelegate { 我正在做json解码器程序,我从json中检索数据,并试图将其保存在表视图中。我遇到了类似的错误。请根据需要对其进行排序 cell.textLabel?.text = madhu[row].title // e.x title 其中title是String类型的模型内的属性名称共享模型DataModelstruct-DataModel:D

类ViewController:UIViewController、UITableViewDataSource、UITableViewDelegate {

我正在做json解码器程序,我从json中检索数据,并试图将其保存在表视图中。我遇到了类似的错误。请根据需要对其进行排序

cell.textLabel?.text = madhu[row].title  // e.x title 

其中
title
是String类型的模型内的属性名称

共享模型
DataModel
struct-DataModel:Decodable{let-name:String-let-img:String-let-legs:Int}它是我的数据模型
cell.textLabel?.text = madhu[row].title  // e.x title