Я создал segue от кнопки, но это дало мне следующую ошибку. Я использую Swift и Xcode 6.Добавить идентификатор для segue
/Users/dave_cooljamdesign/Desktop/XcodeDev/findaphysio2/FindaPhysio/FindaPhysio/Base.lproj/Main.storyboard: Segues initiated directly from view controllers must have an identifier
Как я могу дать им идентификатор, когда я draging с точки зрения таблицы с точки зрения детализации?
Ниже приведен код, чтобы показать, что я делаю в контроллере представления
import UIKit
import MapKit
class ClinicsTableViewController:
UITableViewController {
var clinic = [Clinics]()
@IBOutlet var mapView: MKMapView!
override func viewDidLoad() {
super.viewDidLoad()
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem()
self.clinic = [Clinics(name:"Chocolate")]
self.tableView.reloadData()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Table view data source
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Potentially incomplete method implementation.
// Return the number of sections.
return 0
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete method implementation.
// Return the number of rows in the section.
return self.clinic.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
//ask for a reusable cell from the tableview, the tableview will create a new one if it doesn't have any
let cell = self.tableView.dequeueReusableCellWithIdentifier("findaphysioCell", forIndexPath: indexPath) as UITableViewCell
// Get the corresponding candy from our candies array
let _clinic = self.clinic[indexPath.row]
// Configure the cell
cell.textLabel!.text = _clinic.name
cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator
return cell
}
}
выберите segue в раскадровке и команду + вариант + 4. – gabbler