     // 行数
     func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         if self.json != nil {
-            return self.json!.count
-        }else{
-            return 0
+        return self.json!.count
+    }else{
+        return 0
         }
     }
     
     func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
-        return floor(TableCellLayout(str: json![indexPath.row]["message"].stringValue,
-            w: self.view.bounds.size.width).h)
+        return heights[indexPath.row]
     }
     
     // セルの設定

        
        Socket.on("get") {data, ack in
            UIApplication.sharedApplication().networkActivityIndicatorVisible = false
            dispatch_async(dispatch_get_main_queue(), { () -> Void in
                self.json = JSON(data)[0]["comments"]
                if self.tableview != nil {
                    self.tableview.reloadData()
                    if self.json?.count != 0{
                        self.tableview.scrollToRowAtIndexPath(NSIndexPath(forRow: self.json!.count-1, inSection: 0), atScrollPosition: UITableViewScrollPosition.Bottom, animated: false)
                    }
                    self.comLabel.text = "\(self.json!.count)"
                }
            })
            if self.live_status! == true {
                self.Socket.emit("join", [

    var IconImage:Dictionary<String,UIImage> = Dictionary()
    var Socket: SocketIOClient!
    var json:JSON?
    var heights:[CGFloat]=[]
    var live_status:Bool!
    var timer :NSTimer?
    let api = CaveAPI()
