title: Xcode console debugging output
body: <p>I am downloading data from firebase and displaying the data onto a tableView. However, I am finding that every now and then there appears to be duplicated content in my tableView. I initially thought that I have accidentally inserted the same content in my PostService.ps.posts array. However, after I put a break point just before I reload the tableView, I typed the following command in the console and the output is weird.</p>
  
  <blockquote>
    <p>print PostService.ps.posts</p>
  </blockquote>
  
  <p>As shown in the output below, item [4] and item [6] has {...} which I dont know what they stand for (This is the first time I am using console command to debug). And in my tableView. I see the the data displayed in the following sequence [1],[2],[3],[3],[5],[5],[6],[7],[8],[9] (for row 0 to row 8). So it appears that row 3 (starting form 0) is getting the same data as row 2 and row 5 is the getting the same data as row 4. Weird?</p>
  
  <p>I am not sure why this is happening and I have no where to start because it doesnt happen every time. I am hoping this console output would help pointing me to the correct way</p>
  
  <pre><code>  [1] = 0x000000012f4849b0 {
      _postKey = "-KQTh_WDO2IS1rYfLgnU"
      _userId = "SpmZmYwD3Td04sQZxOYeALwuMp03"
    }
  
    [2] = 0x0000000130e61f40 {
      _postKey = "-KQTHnE4IIeBR3tyDM3r"
      _userId = "1isMS98ZmXYrpCmGb4o5voaAqXH2"
      _image = "www.image2.com"
    }
  
    [3] = 0x0000000130192b40 {
      _postKey = "-KQtN4YG51HOF19FrM8s"
      _userId = "SpmZmYwD3Td04sQZxOYeALwuMp03"
      _image = "www.image3.com"
    }
  
    [4] = 0x0000000130192b40 {...}
  
    [5] = 0x0000000130269560 {
      _postKey = "-KR2On6u7dRy0GAvE1Gn"
      _userId = "SpmZmYwD3Td04sQZxOYeALwuMp03"
      _image = "www.image4.com"
    }
  
    [6] = 0x0000000130269560 {...}
  
    [7] = 0x000000013150f4c0 {
      _postKey = "-KQThGLVA-MsviGMsXOS"
      _userId = "1isMS98ZmXYrpCmGb4o5voaAqXH2"
      _image = "www.image5.com"
    }
  
    [8] = 0x000000012fa88890 {
      _postKey = "-KQt269uHGM99oFKuJRt"
      _userId = "SpmZmYwD3Td04sQZxOYeALwuMp03"
      _image = "www.image6.com"
    }
  
    [9] = 0x000000012f9bcad0 {
      _postKey = "-KQThdCAm-PlCsCnXcBZ"
      _userId = "SpmZmYwD3Td04sQZxOYeALwuMp03"
    }
  </code></pre>
  
  <p>All my table data are configured based on the data inside my PostService.ps.posts which is of type [Post]
  Inside my viewForHeaderInSection (I am using this instead of cellForRowAtIndexPath in my app), I have the following code to configure the table</p>
  
  <pre><code>    if let cell = tableView.dequeueReusableHeaderFooterViewWithIdentifier("TableSectionHeader") as? TableSectionHeader {
          let post = PostService.ps.posts[section]
          var image: UIImage?
          if let url = post.imageUrl {
              image = DiscoverVC.imageCache.objectForKey(url) as? UIImage
          }            
          cell.configureCell(post, image: image)
          cell.delegate = self
  
          return cell
  
      } else {
          return TableSectionHeader()
      }
  </code></pre>