I Am Trying To Log Touch Coordinat… | Apple Developer Forums
Maybe your like
- Global Nav Open Menu Global Nav Close Menu
- Apple Developer
- Apple Developer
- News
- Discover
- Design
- Develop
- Distribute
- Support
- Account
Quick Links
5 Quick Links Developer Forums Search for a topic, subtopic, or tag Clear search query Local Nav Open Menu Local Nav Close Menu Post Profile- Sign in
- Create account
I am trying to log touch coordinates into the CSV file, but I am getting "No exact matches in call to initializer" error. I need to parse the touch coordinates as String. What is going wrong here?
super.touchesBegan(touches , with: event) let touch = touches.first! let location = touch.location(in: view) //Returns the current location of the receiver in the coordinate system. let mylocation = String(location) ***No exact matches in call to initializer // print("touches began \(location)") let fileName2 = "testing2.csv" // CSV filename let documentDirectoryPath2 = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as String let documentURL2 = URL(fileURLWithPath: documentDirectoryPath2).appendingPathComponent(fileName2) let output2 = OutputStream.toMemory() // stream data into memory let csvWriter2 = CHCSVWriter(outputStream: output2, encoding: String.Encoding.utf8.rawValue, delimiter: unichar(",".utf8.first!)) csvWriter2?.writeField("Timestamp") csvWriter2?.writeField("Timestamp in miliseconds") csvWriter2?.finishLine() //Array to add data var arrOfTimestamp = [[String]]() // var arrOfTimeInMiliSec = [[Int]]() arrOfTimestamp.append([mylocation]) // arrOfTimeInMiliSec.append([time]) for(elements) in arrOfTimestamp.enumerated() { csvWriter2?.writeField(elements.element[0]) } csvWriter2?.closeStream() let buffer = (output2.property(forKey: .dataWrittenToMemoryStreamKey) as? Data)! do{ try buffer.write(to: documentURL2) } catch { } Boost Copy to clipboard Share this post Copied to Clipboard Replies 1 Boosts 0 Views 676 Participants 2 robnotyou OP Jun ’22Instead of:
let mylocation = String(location)Try:
let mylocation = String("\(location.x),\(location.y)") 0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment I am trying to log touch coordinates into the CSV file, but I am getting "No exact matches in call to initializer" error First post date Last post date QTag » App Storage No Exact Matches In Call To Initializer
-
No Exact Matches In Call To Initializer Error Message In Swift
-
SOLVED: Help With Error: "No Exact Matches In Call To Initializer"
-
No Exact Matches In Call To Initializer Error Message In Swift
-
No Exact Matches In Call To Initializer Error ...
-
IOS : No Exact Matches In Call To Initializer Error Message In Swift
-
No Exact Matches In Call To Instance Method Error Message In Swift
-
No Exact Matches In Call To Initializer With UnsafeMutablePointer
-
No Exact Matches In Call To Initializer" Using OpenKitten/BSON ...
-
[Solved] No Exact Matches In Call To Initializer For AnchorEntity
-
Initialization — The Swift Programming Language (Swift 5.7)
-
Majid Jabrayilov On Twitter: "This Week We Will Talk About New ...
-
"No Exact Matches In Call To Instance Method 'datatask'"... How Do I ...
-
SceneStorage For Custom Types - Use Your Loaf
-
No Exact Matches In Call To Initializer Error ... - Copy Programming