私はコードの初心者ですが、実際には数週間前にこの世界に参加しました。 私はXcodeとSwiftを使ってIos用の最初のアプリケーションを構築しようとしています。 異なるテーブルビューを作成し、これらのテーブル間でデータを渡したいとします。構造体と配列を使用してテーブルビュー間でデータを渡す(Swift:Xcode)
今、コードを作成しましたが、私は "Expected Declaration"エラーを受けています。私は本当にそれを修正する方法を理解していません。誰か助けてくれますか?おかげさまで
//
// ViewController.swift
// Tot_Forum
//
// Created by Fausto Saltetti on 18/07/16.
// Copyright (c) 2016 Fausto Saltetti. All rights reserved.
//
import UIKit
class FirtTableViewController: UITableViewController {
var FirstTableArray = [String]()
var SecondArray = [SecondTable]()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
FirstTableArray = ["Focus on learning", "Participate and network", "Access and build knowledge", "Assess, reflect, evaluate", "Inspire and generate ideas", "Problem solve and plan", "Map ideas and relationships"]
SecondArray =
[SecondTable(SecondTitle: ["After Action Review","Audience Response Systems","Blogs","Case Studies", "Discussion Forums UPDATE","Jigsaw","Peer Assist", "Podcasting","Presentations", "Role Play", "Screencasting", "Social Networking", "Sociometrics"]),
SecondTable(SecondTitle: ["After Action Review","Audience Response Systems","Blogs","Case Studies", "Discussion Forums UPDATE","Jigsaw","Peer Assist", "Podcasting","Presentations", "Role Play", "Screencasting", "Social Networking", "Sociometrics"]),
SecondTable(SecondTitle: ["After Action Review","Audience Response Systems","Blogs","Case Studies", "Discussion Forums UPDATE","Jigsaw","Peer Assist", "Podcasting","Presentations", "Role Play", "Screencasting", "Social Networking", "Sociometrics"])]
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return FirstTableArray.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var Cell = self.tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
Cell.textLabel?.text = FirstTableArray[indexPath.row]
return Cell
func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
var indexPath : NSIndexPath = self.tableView.indexPathForSelectedRow()!
var DestViewController = segue.destinationViewController as! SecondTableViewController
var SecondTableArrayTwo : SecondTable
SecondTableArrayTwo = SecondArray[indexPath.row]
DestViewController.SecondArray = SecondTableArrayTwo.SecondTitle
}
} **//Error here: !Expected declaration**
閉じ括弧は、「}」あなたのクラスの –