Я пытаюсь перенести данные с одного viewController на другой. Я подключил viewController к другому диспетчеру навигации ViewController, а затем установил идентификатор в "showItemSegue"
. Я получаю сообщение об ошибке в этих двух строках: иллюстрацияПередача данных с помощью segue через navigationController
var detailController = segue.destinationViewController as ShowItemViewController
detailController.currentId = nextId!
Изображение:
Код:
override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
nextId = itemArray?.objectAtIndex(indexPath.row).objectForKey("objectId") as? NSString
self.performSegueWithIdentifier("showItemSegue", sender: self)
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
if (segue.identifier == "showItemSegue") {
var detailController = segue.destinationViewController as ShowItemViewController
detailController.currentId = nextId!
}
}
Пожалуйста отправьте сообщение об ошибке полного –