私は最近このコードでいくつかのエラーを修正しましたが、新しいコードが表示され、私と先生はそれを修正できませんでした。 「期待される宣言」と書かれています これはどうやって解決しますか?テーブルビューの行を削除
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var StoredValues = Values()
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return UITableViewCell()
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 4
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.performSegue(withIdentifier: "meunSegue", sender: self)
func prepare(for segue: UIStoryboardSegue, sender: Any?) {
_ = segue.destination as! SecondViewController
}
class SecondViewController: UIViewController {
var recievedData = ""
override func viewDidLoad() {
super.viewDidLoad()
print(recievedData)
}
}
}
- (void)tableView:(UITableView *)tableView committEditStyle: (UITableViewCellEditingStyle)editingStyle forRowAtIndexPath: (NSIndexPath *)indexPath {if (editingStyle == UITableViewCellEditingStyleDelete) {
[maTheData removeObjectAtIndex: [indexPath row]];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
少なくとも基本的な知識を持っている別の教師を探してください。デリゲートメソッドやクラス宣言まで入れ子にしています。 – vadian