Sfoglia il codice sorgente

Order network transactions from newest first.

We’ll generally be more interested in the most recent requests.
Ryan Olson 11 anni fa
parent
commit
6d680e4df7

+ 1 - 1
Classes/Network/FLEXNetworkRecorder.h

@@ -22,7 +22,7 @@ extern NSString *const kFLEXNetworkRecorderUserInfoTransactionKey;
 
 // Accessing recorded network activity
 
-/// Array of FLEXNetworkTransaction objects ordered by start time with the oldest first.
+/// Array of FLEXNetworkTransaction objects ordered by start time with the newest first.
 - (NSArray *)networkTransactions;
 
 /// The full response data IFF it hasn't been purged due to memory pressure.

+ 1 - 1
Classes/Network/FLEXNetworkRecorder.m

@@ -78,7 +78,7 @@ NSString *const kFLEXNetworkRecorderUserInfoTransactionKey = @"transaction";
         transaction.startTime = [NSDate date];
         transaction.transactionState = FLEXNetworkTransactionStateAwaitingResponse;
 
-        [self.orderedTransactions addObject:transaction];
+        [self.orderedTransactions insertObject:transaction atIndex:0];
         [self.networkTransactionsForRequestIdentifiers setObject:transaction forKey:requestId];
 
         [self postNewTransactionNotificationWithTransaction:transaction];