title: Error Domain=NSCocoaErrorDomain Code=256
body: <pre><code>    override func viewDidLoad() {
      super.viewDidLoad()
      let dataURLString: String = Bundle.main.path(forResource: "IMG_0568", ofType: "JPG")!
      let dataURL = URL(string: dataURLString)
      do {
          let binaryData = try Data(contentsOf: dataURL!, options: [])
          let kbData = binaryData.subdata(in: 0..&lt;1024)
          let stringArray = kbData.map{String(format: "%02X", $0)}
          let binaryString = stringArray.joined(separator: "-")
          print(binaryString)
          editorTextView.text = (binaryString)
      } catch {
          print("Failed to read the file.")
          //Error Domain=NSCocoaErrorDomain Code=256 "The file “IMG_0568.JPG” couldn’t be opened." UserInfo={NSURL=/Users/..../IMG_0568.JPG}
      }
  </code></pre>
  
  <p>I want to display the Binary Data of Image File that I have added to my Xcode project (image name: <code>IMG_0568.JPG</code>). </p>
  
  <p>But there's the error</p>
  
  <blockquote>
    <p>(Error Domain=NSCocoaErrorDomain Code=256 "The file “IMG_0568.JPG”
    couldn’t be opened." UserInfo={NSURL=/Users/..../IMG_0568.JPG})</p>
  </blockquote>
  
  <p>How can I fix this problem?</p>