title: AnyObject does not have a member named generator
body: <p>I don't have enough reputation to post images </p>
  
  <p>The problem is when I did the following</p>
  
  <blockquote>
    <p>for object in objects { eg: ....</p>
    
    <p>// [AnyObject] does not have a member named generator - It shows me
    this error</p>
    
    <p>}</p>
  </blockquote>
  
  <p>And after my search in stackoverflow and some other sites I did this:</p>
  
  <pre><code>if objects?.count &gt; 0 {
  
  for object in objects! {
  
  self.resultsUsernameArray.append(object.username) -&gt; The error is "Cannot invoke append with an argument list of type (String?!)"
  
  }
  
  } else {
  
  }
  </code></pre>
  
  <p><code>[AnyObject]</code> does not have a member named generator || cannot invoke append with an argument list of type <code>(String?!)</code></p>
  
  <pre><code>import UIKit
  
  var userName = ""
  
  class UsersViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  
  @IBOutlet weak var resultsTable: UITableView!
  
  var resultsUsernameArray = [String]()
  var resultsProfileNameArray = [String]()
  var resultsImageFiles = [PFFile]()
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      let theWidth = view.frame.size.width
      let theHeight = view.frame.size.height
  
      resultsTable.frame = CGRectMake(0, 0, theWidth, theHeight - 64)
  
      userName = PFUser.currentUser()!.username!
  
  }
  
  
  
  override func viewDidAppear(animated: Bool) {
      super.viewDidAppear(animated)
  
      let predicate = NSPredicate(format: "username !="+userName+"'")
      var query = PFQuery(className: "_User", predicate: predicate)
  
      var objects = query.findObjects()
  
      for object in objects { // [AnyObject] does not have a member named generator
  
          self.resultsUsernameArray.append(object.username)
          self.resultsProfileNameArray.append(object["profileName"] as! String)
          self.resultsImageFiles.append(object["photo"] as! PFFile)
  
          resultsTable.reloadData()
  
      }
  
  }
  
   func tableView(tableView: UITableView, numberOfRowsInSection eg..... {
  }
  </code></pre>
  
  <p>Help me please</p>