title: How to create a String with all objects from a core data class
body: <h3>Explanation</h3>
  <p>In my app I want to add the ability to export the data of a member. Im talking about all the transactions of the member. This is what I have, I hope it's clear what I'm asking.
  What do I have to edit, that it works? Or is my way the right?</p>
  <pre><code>var str: [String] = []
  for trans in (member?.transactions!)! {
      let trnsctnr = trans.reason
      let trnsctna = String(trans.money)
      var trnsctnd = &quot;&quot;
      if let trnsd = trans.date{
          trnsctnd = dateFormatter.string(from: trnsd)
      }
      str = [trnsctnr, trnsctna, trnsctnd] as! [String]
  }
  </code></pre>
  <p>This code doesn't work. I want to add this in a 'MFMailComposerController' and than this error is shown :</p>
  <blockquote>
  <p>Cannot convert value of type 'Never' to expected argument type 'String'</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/WVet1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WVet1.png" alt="Core Data Model" /></a></p>
  <p>So I want to export the data of all transactions which the member did.</p>
  <p>What I did as a computed property:</p>
  <pre class="lang-swift prettyprint-override"><code>struct stringForMFMail {
              let trnsctnr = transaction?.reason
              var trnsctna = &quot;&quot;
              if let trns  = transaction?.money {
                  trnsctna = String(trns)
                  
              }
              var trnsctnd = &quot;&quot;
              if let trnsd = transaction?.date{
                  trnsctnd = dateFormatter.string(from: trnsd)
              }
              let dataString = [trnsctnr, trnsctna, trnsctnd]
              
  
              }
  </code></pre>
  <p>This doesn't work at all, so I'm sure I did it completely wrong. There are some errors like: Struct declaration cannot close over value 'self' defined in outer scope. Totally there are 12 error in this little part so I did something really wrong.</p>