Commit 90802b2

mo khan <mo@mokhan.ca>
2013-07-15 01:35:36
display loading cell when fetching the latest creations
1 parent b53a35d
Changed files (1)
cakeside-ios
cakeside-ios/controllers/CreationsTableViewController.m
@@ -92,7 +92,7 @@
 {
   if (!self.data || self.data.count == 0)
   {
-    return 0;
+    return 1;
   }
   else
   {
@@ -102,6 +102,17 @@
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
+  if(!self.data || self.data.count == 0)
+  {
+    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LoadingCell"];
+    if (cell == nil)
+    {
+      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"LoadingCell"];
+    }
+    cell.textLabel.text = @"Loading...";
+    return cell;
+  }
+
   UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CakeCell"];
   if (cell == nil)
   {