title: How do I get the last record of a Core Data database?
body: <p>I have a core data entity called images that has just 2 fields:</p>
  
  <pre><code>imageName = NSString
  timeStamp = NSNumber
  </code></pre>
  
  <p>I am trying to simulate a kind of stack LIFO (last in first out). 
  Inserting a new entry is easy but what about reading the last entry added to the entity?</p>
  
  <p>All images are added with a timestamp, obtained by using</p>
  
  <pre><code>time_t unixTime = (time_t) [[NSDate date] timeIntervalSince1970];
  </code></pre>
  
  <p>an integer that is equal to the number of seconds since 1970 </p>
  
  <p>so, how do I retrieve the last inserted record of a core data (= the record that has the biggest timestamp number)???</p>
  
  <p>thanks</p>