I am currently trying to write a small iOS application in swift where I have the following classes:
masterTableViewController addViewControllerand deleteViewController, each of them is associated with a, as already mentioned, viewController. The TableViewController wizard must send some data using a predefined function:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
if(segue.identifier == "showDetails") {
var selectedIndexPath:NSIndexPath = self.tableView.indexPathForSelectedRow()!
var deleteViewController:deleteViewController = segue!.destinationViewController as deleteViewController
deleteViewController.todoData = todoItems.objectAtIndex(selectedIndexPath.row) as NSDictionary
}
I want to send the data of the current row to the next one, according to the specified segue controller.
Here I get an error indicating that deleteViewController is not a type that can be assigned to a variable.
But I do not quite understand what the problem is now. Basically, this should work because I just want to create a new object of the type that my class belongs to and pass it to this controller.
, .