         
         //store the created chatroom c1 into global variable cR1
         cR1 = c1
+
         
         /********* End of Dummy data *********/
         


        
        //Create user u1
        let u1:User = User(context: context, id: "1", username: "Komic", avatar: UIImage(named: "Default-Avatar")!, status: User.Status.ONLINE, timezone: NSTimeZone.systemTimeZone())
        
        //Create some messages for u1
        let msg1:Message = Message(id: "1", text: "Message 1 from Komic", tstamp: NSDate(timeInterval: randomTime(), sinceDate: NSDate()), user: u1)

        //Set bottomIndexpath to last cell's index
        bottomIndexPath = NSIndexPath(forRow: cR1!.messages.count-1, inSection: 0)
        mainTableview.scrollToRowAtIndexPath(bottomIndexPath, atScrollPosition: UITableViewScrollPosition.Bottom, animated: true)
      
        //fix for tableview not scrolling all the way to the bottom in iOS 9
        mainTableview.reloadData()
        
