Cannot understand why xcode tries to invoke a subscript, I do not want it from xcode.
I have a simple structure:
struct Point3D
{
var x: Double = 0.0
var y: Double = 0.0
var z: Double = 0.0
init(x:Double, y:Double, z:Double) {self.x = x; self.y = y; self.z = z}
}
However the code under doesn't working, it says: Cannot invoke 'subscript' with an argument list of type '(x: Double, y: Double, z: Double)'
. But as you can see, I have an init with these types...
private func convertFileStringToPoint3D(str:String)->Point3D
{
let components_file_string_point3d = str.componentsSeparatedByCharactersInSet(NSCharacterSet(charactersInString: " \t"))
if components_file_string_point3d.count>2 {
return Point3D(x: Double(components_file_string_point3d[0]), y: Double(components_file_string_point3d[1]), z: Double(components_file_string_point3d[2]))
} else {
assertionFailure("Wrong File Structure. Cannot convert string to Point3D.")
}
}
And when I try to use doublevalue of NSString it says that it didn't have a member called doublevalue...
I'm so embaressed :( I just missed with one character doublevalue instead doubleValue... This is duplicate, so delete please, there is no question, ust mistake...