title: Type '[Class]?' has no member '[Variable]'
body: <p>I am trying to build a movie archive app for iOS. But i am getting this error when i try to use my class which i defined in another controller.</p>
  
  <blockquote>
    <p>Type 'Movie?' has no member 'name'</p>
  </blockquote>
  
  <p><br>
  I have 4 Controller files;</p>
  
  <ul>
  <li>movieListVC</li>
  <li>movieDetailVC</li>
  <li>movieAddVC</li>
  </ul>
  
  <p><br>
  and 2 .swift files;</p>
  
  <ul>
  <li>File </li>
  <li>Movie (this is the file I defined my class)
  <br>
  <br></li>
  </ul>
  
  <p>Movie.swift:</p>
  
  <pre><code>class Movie: NSObject {
    var name : String
    var director : String
    var year : String
    var posterURL : String
  
    override init(){
        self.name = ""
        self.director = ""
        self.year = ""
        self.posterURL = ""
    }
  }
  </code></pre>
  
  <p><br>
  I can reach my class when I use movieListVC like it should be.</p>
  
  <p><br>
  movieListVC:</p>
  
  <pre><code>var selectedMovie : Movie?
  
              .
              .
              .
  
  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    self.selectedMovie = Movie()
    let temp = self.movies[indexPath.row] as! Dictionary&lt;String, AnyObject&gt;
  
    selectedMovie!.name = temp["name"]! as! String
    selectedMovie!.director = temp["director"] as! String
    selectedMovie!.year = temp["year"] as! String
    selectedMovie!.posterURL = temp["posterURL"] as! String
  
    self.performSegue(withIdentifier: "detail", sender: self)
  
    let movieName = temp["name"] as! String
    print("Name of the selected movie: \(movieName)")
  }
  </code></pre>
  
  <p><br>
  Xcode doesn't give any error for my movieListVC, but when i use same thing in movieDetailVC, it gives me the error.</p>
  
  <p><br>
  movieDetailVC:
  <br></p>
  
  <pre><code>var movieToShow : Movie?                             // Expected member name or constructor call after type name
              .
              .
              .
   override func viewDidLoad() {
     super.viewDidLoad()
     if (self.movieToShow == nil) {
         return;
     }
  
     labelMovieName.text = movieToShow!.name           // Type 'Movie?' has no member 'name'
     labelMovieDirector.text = movieToShow!.director   // Type 'Movie?' has no member 'name'
     labelMovieYear.text = movieToShow!.year           // Type 'Movie?' has no member 'name'
     let image = UIImage(data: try! Data(contentsOf: 
               URL(string: movieToShow!.posterURL)))   // Type 'Movie?' has no member 'name'
     imageViewPoster.image = image
  }
  </code></pre>
  
  <p><br><br>
  Edit 1: I also use movieToShow in here for information:</p>
  
  <pre><code>override func prepare(for segue: UIStoryboardSegue?, sender: Any!) {
      if segue!.identifier == "detail" {
          let viewController:movieDetailViewController = segue!.destination as! movieDetailViewController
  
          viewController.movieToShow = self.selectedMovie
      }
  }
  </code></pre>