title: SWIFT XCODE error
body: <p>I am a complete beginner in coding. I managed to get some working code in Playground but once I moved to building a project nothing worked.
  This is for OS X.
  I have used the following simple lines of code in Playground and AppDelegate contexts.  It runs and outputs to the console without error in Playground but returns an error in AppDelegate.swift - Expected declaration for the " for num in availcrop" line with a red arrow under the f in for.</p>
  
  <pre><code>var availcrop = [0, 1, 2, 3, 4, 5, 6, 7]
   for num in availcrop
   {
      var ran = 1000+randInt(2000)
      availcrop[num] = ran
      println(availcrop[num])
  
   }
  </code></pre>
  
  <p>- the println is not planned for the project.  Just in the Playground for testing
  Both have imported Cocoa.  One runs and the other crashes. In Playground the array name avail crop is blue implying it is recognised I suppose.  In the AppDelegate.swift it remains grey.</p>