title: Objective-C: View displays empty Table since API takes time to fetch from Server
body: <p>I have a <code>TransactionViewController</code> that during instantiation fetches data from <code>API</code> and looks like  </p>
  
  <pre><code>- (id)init {
      self = [super init];
      if (self) {
          TransactionsModel *transactionsModel = [TransactionsAPI getTransactionsForYear:2014 AndMonth:9];
          self.transactionsModel = transactionsModel;
      }
      return self;
  
  }
  </code></pre>
  
  <p>The <code>API</code> get data as following  </p>
  
  <pre><code>+ (TransactionsModel *)getTransactionsForYear:(int)year AndMonth:(int)month {
      NSDictionary *transactions = [self getTransactions];
      NSLog(@"transactions: %@", transactions);
      return [[TransactionsModel alloc] initWithJson:transactions];
  }
  </code></pre>
  
  <p>and  </p>
  
  <pre><code>+ (NSDictionary *)getTransactions {
      AFHTTPRequestOperationManager *manager = [RestHelper getSecureManager];
      __block NSDictionary* transactions = nil;
  
      [manager GET:[appUrl stringByAppendingString:@"rest/transactions/2014/11"] parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
  
          transactions = responseObject;
      }    failure:^(AFHTTPRequestOperation *operation, NSError *error) {
          NSLog(@"Error: %@", error);
      }];
      return transactions;
  }
  </code></pre>
  
  <p>I am using <code>AFNewtworking 2.0</code> in which every call is <code>asynchronous</code>, right?</p>
  
  <p><strong>Question</strong> 
  How do I wait to display my <code>Table</code> until data is fetched from server?  </p>
  
  <p><code>P.S</code> I am new to <code>iOS</code> programming and looking for recommended ways to solve these issues. Thanks</p>