import UIKit
class FishTableViewController: UITableViewController {
//MARK: Properties
var fish = [Fish]()
override func viewDidLoad() {
super.viewDidLoad()
//load fish example cell
loadSampleFish();
}
func loadSampleFish(){
let grouperPhoto = UIImage(named: "blackgrouper");
let exampleFish = Fish(name: "Black Grouper", photo: grouperPhoto);
fish += [exampleFish];
}
未解决的标识符" var fish = Fish"和#34;让exampleFish = Fish(名字:" Black Grouper",照片:grouperPhoto);"
答案 0 :(得分:0)
确保使用与tableviewcontroller相同的目标定义Fish类。在File Inspector中查看“目标成员资格”。