delete side
varid:Int?
Various codes
appdelegate.id=self.data [indexPath.row]["id"]as Int
I'd like to save important data from the API to delete.
Cannot assign a value of type Int to a value of type Int?
It says
The other code I want to save the name is string, so
Cannot assign a value of type String to a value of type String?
It says
I don't know how to deal with this error since I set it to xcode7.
Thank you for your cooperation
I don't know how to deal with this error since I set it to xcode7.
The part that has been changed since Xcode 6.3, and the Swift version is changed from 1.2.Read Apple's public documents directly.
Swift Blog Feb 18, 2015
The downcast format has changed since Swift 1.2.Downcasting to the Optional type goes from 」as から to 」as?
appdelegate.id=self.data [indexPath.row] ["id"] as Int
This is
appdelegate.id=self.data [indexPath.row]["id"]as? Int
If so, the error should no longer appear.
© 2024 OneMinuteCode. All rights reserved.