Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath entity.isTemporaryID not found in entity &lt;NSSQLEntity Cocktail id=4&gt;' </code></pre> <p>How can one execute the equivalent of [[cocktail objectID] isTemporaryID] in an NSPredicate?</p> </blockquote> <p>Do that.</p> <p>What you asked for is not <code>[[cocktail objectID] isTemporaryID]</code>, it's <code>[[cocktail entity] isTemporaryID]</code>. If you want <code>objectID</code> (which you do, since you want to ask it whether it's a temporary ID), then that's what you need to ask for in your key path.</p> <p>You should read the <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/KeyValueCoding/" rel="nofollow noreferrer">Key-Value Coding Programming Guide</a>, even if you've read it already, and look up the <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html#//apple_ref/occ/instm/NSManagedObject/entity" rel="nofollow noreferrer"><code>entity</code></a> and <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html#//apple_ref/occ/instm/NSManagedObject/objectID" rel="nofollow noreferrer"><code>objectID</code></a> methods in <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html" rel="nofollow noreferrer">the NSManagedObject reference</a>. From these, you'll find it clear that Marcus Zarra either mixed the two up or meant <code>objectID</code> but typed <code>entity</code> by accident. It happens to everyone—that's why it's good to always check the docs.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload