I have a swift project in which i want to retrieve the name of the device and show in in a UITableViewCell.
But when i want to call UIDevice.currentDevice() in
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
the compiler fails with:
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
The following build commands failed:
CompileSwift normal arm64 "path to project folder"/custom_tableview_controller.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (2 failures)
The awkward thing is calling UIDevice.currentDevice() in any other file than my custom_tableview_controller.swift file is working.
Additional information:
- Xcode 6.4(6E35b)
- Debug

UIDevice.currentDevice()- hris.todsl_textfield_cell!.dsc_textfield.text = UIDevice.currentDevice().nameis the full line, but it also won't compile when i just writeUIDevice.currentDevice()in a new line without using it - manuelwaldner