title: For loop based on array length in Swift
body: <p>I have been trying to take the length of an array and use that length to set the amount of times that my loop should execute. This is my code:  </p>
  
  <pre><code>  if notes.count != names.count {
          notes.removeAllObjects()
          var nameArrayLength = names.count
          for index in nameArrayLength {
              notes.insertObject("", atIndex: (index-1))
          }
      }
  </code></pre>
  
  <p>At the moment I just get the error: </p>
  
  <pre><code>Int does not have a member named 'Generator'
  </code></pre>
  
  <p>Seems like a fairly simple issue, but I haven't yet figured out a solution. Any ideas?</p>