I don't understand what is ambiguous about my use of book.numberOfPages in my TableViewController. I'm not having any problems with using any of the other attributes. There shouldn't be any ambiguity here: I have defined it as a Float in the data model editor and at the top of the TableViewController.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showBookDetail" {
let indexPath:NSIndexPath = self.tableView.indexPathForSelectedRow()!
let book: AnyObject = addBookViewController.fetchedResultsController.objectAtIndexPath(indexPath) as! Book
var detailViewController:BookDetailViewController = segue.destinationViewController as! BookDetailViewController
detailViewController.title = book.name
detailViewController.pagesReadText = "\(Int(book.pagesRead))"
detailViewController.timeReadText = "\(Int(book.timeRead))"
println(book.numberOfPages)
}
}
Aucun commentaire:
Enregistrer un commentaire