Note that there are some explanatory texts on larger screens.

plurals
  1. POCorruption of NSManagedObject-derived objects when property is accessed
    primarykey
    data
    text
    <p>I have a class that at some point gets a bunch of data with a Core Data fetch and then inserts the objects, created in the usual Core Data way in XCode and therefore derived from <code>NSManagedObject</code>, into an <code>NSMutableSet</code>. Depending on how things work out, some of these objects might end up in several other sets. So far, so good. </p> <p>But then the following happens: </p> <pre><code>NSMutableArray* anArray = [NSMutableArray alloc] init; [currentResults minus:previousResults]; // both are NSMutableSets for(MyObject* obj in currentResults) { [anArray addObject:[createAnnoFromMyObject:obj]]; // nastiness happens here } </code></pre> <p>All <code>createAnnoFromMyObj:</code> does is pull data out of <code>obj</code> and return a object that implements <code>MKAnnotation</code>.</p> <p>The problem is that although I get an array of usable annotations, <code>currentResults</code>, <code>previousResults</code>, and any other objects that references any of the <code>MyObject</code>s that were touched by <code>createAnnoFromMyObject:</code> end up getting trashed. </p> <p>By trashed I mean that trying to access them results in an exception along the lines of</p> <pre><code>-[MyObject beginningOfDocument]: unrecognized selector sent to instance... </code></pre> <p>The same happens when trying to view any of these collections in the debugger pane with the <code>po</code> command.</p> <p>We tried regenerating <code>MyObject</code> in Core Data but no luck. There is very little mention of this <code>beginningOfDocument</code> selector on Google and we have no idea what coudl be wrong. Although we have a workaround that will probably eliminate this issue, it would be really nice to know what is going on.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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