What is the difference between these two methods to get string value of indexed path.
Override Function TableView (TableView: UITableView, CellForUroutAndExpath IndexPath: NSIndexpath) - & gt; UITableViewCell {var newString: String = String (indexPath.row) var newString2: string = indexPath.row.description}}
description property is used to represent any printable protocol and though
NSObject
or the content of any class / structure / enum Int
( indexPath.row
is in the case of int
) it is just string Lets change the string
To change the int
, should never be used . It is possible that things like Swift description
will be returned in future versions of "int: [value"]. Instead you should use the string (indexPath.row)
.
No comments:
Post a Comment