title: Swift xcode error: "Instance 'animal' cannot be used on type 'Animal'"
body: <p>EDIT: HAVE CODE COPY/PASTE OPTION
  I'm getting an error within the "cellForRowAtIndexPath" aka "TableView" Function that says instance "animal" cannot be used on type 'Animal'. </p>
  
  <p>Here is the AppDelegate class</p>
  
  <pre><code>import UIKit
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
      var window: UIWindow?
      func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
          // Override point for customization after application launch.
          return true
      }
      func applicationWillResignActive(application: UIApplication) {
          // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
          // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
      }
  
      func applicationDidEnterBackground(application: UIApplication) {
          // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
          // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
      }
  
      func applicationWillEnterForeground(application: UIApplication) {
          // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
      }
  
      func applicationDidBecomeActive(application: UIApplication) {
          // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
      }
  
      func applicationWillTerminate(application: UIApplication) {
          // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
      }
      func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
          let animal = Animal.animals[indexPath.row]
          let cell = tableView.dequeueReusableCellWithIdentifier("Animal name", forIndexPath: indexPath) as UITableViewCell
          /*var name: String
          var shortDescription: String
          var longDescription: String
          // Configure the cell...
          */
          cell.textLabel?.text = AnimalListTableViewController.name
          cell.detailTextLabel?.text = AnimalListTableViewController.shortDescription
  
          return cell
      }
  }
  </code></pre>
  
  <p>Here is the AnimalListTableViewController class</p>
  
  <pre><code>import UIKit
  class AnimalListTableViewController: UITableViewController
  {   var name: String
      var shortDescription: String
      var longDescription: String
      override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return 12}
      override func prepareForSegue(segue: UIStoryboardSegue,
          sender: AnyObject?){
              if let detailViewController = segue.destinationViewController as? DetailViewController, let indexPath = self.tableView.indexPathForSelectedRow {
                  detailViewController.animal = animals[indexPath.row]}}
      required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")}
      let animals = [
          Animal(name: "Cow",
              shortDescription: "Cattle",
              longDescription: "A cow is a mature female and bull of an adult male of a bovine family. A heifer is a female cow that hasn't had a calf yet. Cattle is the name for the whole cow family. THere are about 920 different breeds of cows in the world."),
          Animal(name: "Bird",
              shortDescription: "Usually small, has wings, feathers, and can fly.",
              longDescription: "A warm-blooded egg-laying vertebrate distinguished by the possession of feathers, wings, and a beak and (typically) by being able to fly."),
          Animal(name: "Dolphin",
              shortDescription: "A large fish",
              longDescription: "A small gregarious toothed whale that typically has a beaklike snout and a curved fin on the back. Dolphins have become well known for their sociable nature and high intelligence."),
          Animal(name: "Dog",
              shortDescription: "Man's best friend",
              longDescription: "A domesticated carnivorous mammal that typically has a long snout, an acute sense of smell, and a barking, howling, or whining voice. It is widely kept as a pet or for work or field sports."),
          Animal(name: "Zebra",
              shortDescription: "A horse with white and black stripes",
              longDescription: "An African wild horse with black-and-white stripes and an erect mane."),
          Animal(name: "Owl",
              shortDescription: "A large bird that usually comes out at night",
              longDescription: "A nocturnal bird of prey with large forward-facing eyes surrounded by facial disks, a hooked beak, and typically a loud call."),
          Animal(name: "Camel",
              shortDescription: "A horse-like animal that travels the deserts",
              longDescription: "A large, long-necked ungulate mammal of arid country, with long slender legs, broad cushioned feet, and either one or two humps on the back. Camels can survive for long periods without food or drink, chiefly by using up the fat reserves in their humps."),
          Animal(name: "Lizard",
              shortDescription: "A green animal that is very small and has four legs",
              longDescription: "A reptile that typically has a long body and tail, four legs, movable eyelids, and a rough, scaly, or spiny skin."),
          Animal(name: "Monkey",
              shortDescription: "A furry animal that climbs trees.",
              longDescription: "A small to medium-sized primate that typically has a long tail, most kinds of which live in trees in tropical countries."),
          Animal(name: "Jaguar",
              shortDescription: "A very fast animal with four legs and lots of fur",
              longDescription: "A large, heavily built cat that has a yellowish-brown coat with black spots, found mainly in the dense forests of Central and South America."),
          Animal(name: "Chicken",
              shortDescription: "A small legged animal with a red nose.",
              longDescription: "A domestic fowl kept for its eggs or meat, especially a young one."),
          Animal(name: "Mouse",
              shortDescription: "A very small creature with a tail.",
              longDescription: "a small rodent that typically has a pointed snout, relatively large ears and eyes, and a long tail.")]}
  </code></pre>
  
  <p>Here is the Animal class</p>
  
  <pre><code>import UIKit
  class Animal
  {
      var name: String
      var shortDescription: String
      var longDescription: String
      init(name: String, shortDescription: String, longDescription: String)
      {
          self.name = name
          self.shortDescription = shortDescription
          self.longDescription = longDescription
      }
      let animals = [
          Animal(name: "Cow",
              shortDescription: "Cattle",
              longDescription: "A cow is a mature female and bull of an adult male of a bovine family. A heifer is a female cow that hasn't had a calf yet. Cattle is the name for the whole cow family. THere are about 920 different breeds of cows in the world."),
          Animal(name: "Bird",
              shortDescription: "Usually small, has wings, feathers, and can fly.",
              longDescription: "A warm-blooded egg-laying vertebrate distinguished by the possession of feathers, wings, and a beak and (typically) by being able to fly."),
          Animal(name: "Dolphin",
              shortDescription: "A large fish",
              longDescription: "A small gregarious toothed whale that typically has a beaklike snout and a curved fin on the back. Dolphins have become well known for their sociable nature and high intelligence."),
          Animal(name: "Dog",
              shortDescription: "Man's best friend",
              longDescription: "A domesticated carnivorous mammal that typically has a long snout, an acute sense of smell, and a barking, howling, or whining voice. It is widely kept as a pet or for work or field sports."),
          Animal(name: "Zebra",
              shortDescription: "A horse with white and black stripes",
              longDescription: "An African wild horse with black-and-white stripes and an erect mane."),
          Animal(name: "Owl",
              shortDescription: "A large bird that usually comes out at night",
              longDescription: "A nocturnal bird of prey with large forward-facing eyes surrounded by facial disks, a hooked beak, and typically a loud call."),
          Animal(name: "Camel",
              shortDescription: "A horse-like animal that travels the deserts",
              longDescription: "A large, long-necked ungulate mammal of arid country, with long slender legs, broad cushioned feet, and either one or two humps on the back. Camels can survive for long periods without food or drink, chiefly by using up the fat reserves in their humps."),
          Animal(name: "Lizard",
              shortDescription: "A green animal that is very small and has four legs",
              longDescription: "A reptile that typically has a long body and tail, four legs, movable eyelids, and a rough, scaly, or spiny skin."),
          Animal(name: "Monkey",
              shortDescription: "A furry animal that climbs trees.",
              longDescription: "A small to medium-sized primate that typically has a long tail, most kinds of which live in trees in tropical countries."),
          Animal(name: "Jaguar",
              shortDescription: "A very fast animal with four legs and lots of fur",
              longDescription: "A large, heavily built cat that has a yellowish-brown coat with black spots, found mainly in the dense forests of Central and South America."),
          Animal(name: "Chicken",
              shortDescription: "A small legged animal with a red nose.",
              longDescription: "A domestic fowl kept for its eggs or meat, especially a young one."),
          Animal(name: "Mouse",
              shortDescription: "A very small creature with a tail.",
              longDescription: "a small rodent that typically has a pointed snout, relatively large ears and eyes, and a long tail.")]
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tAHN5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tAHN5.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Sbtbh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sbtbh.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Wx3px.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wx3px.png" alt="enter image description here"></a></p>