Note that there are some explanatory texts on larger screens.

plurals
  1. POCoreData relationship fault?
    primarykey
    data
    text
    <p>I have an Order which has a "to-many" relationship with Units. When I try to log the units (NSSet) in Order, I get a fault error:</p> <pre><code>NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Order" inManagedObjectContext:mainContext]; [fetchRequest setEntity:entity]; NSArray *fetchedObjects = [mainContext executeFetchRequest:fetchRequest error:nil]; for (Order *order in fetchedObjects) { NSLog(@"%@", [order units]); break; } [fetchRequest release]; </code></pre> <p>results in:</p> <pre><code>Relationship 'units' fault on managed object (0x6d9dd00) &lt;Order: 0x6d9dd00&gt; (entity: Order; id: 0x6d88e40 &lt;x-coredata://97A3F3D5-ABA7-499A-A460-5E25CF49C528/Order/p1&gt; ; data: { composition = Hemlock; condition = ""; consignee = ""; consigneeCompanyName = ""; contactAlternatePhone = ""; contactEmail = ""; contactFirstName = ""; contactLastName = ""; contactPhone = ""; customer = "Havard Empire"; customerCompanyName = ""; customerNotes = ""; dateDue = "1/13/2012 12:00:00 AM"; dateEntered = "1/6/2012 12:00:00 AM"; dateOrdered = "1/6/2012 12:00:00 AM"; deliveryAddress1 = ""; deliveryAddress2 = ""; deliveryCity = ""; deliverySpecialInstructions = ""; deliveryState = ""; deliveryZip = ""; depth = 01; detail = ""; freightRate = ""; grade = Cull; instructionsDirectionsNotes = ""; lastUpdated = "1/6/2012 3:00:43 PM"; length = 01; location = "Lucedale, ms"; matsPerLoad = ""; memoLineNotes = ""; notes = ""; orderID = 201205134922479; orderNumber = 01062012; pUP = Cable; pricePerItem = ""; purchaseOrderNumber = ""; pushToQuickBooks = True; quantity = 0; quickbooksCompany = 1; salesman = "Accounting Adj"; separateRate = False; taxRate = ""; totalLoads = ""; type = "2ply Mat"; units = "&lt;relationship fault: 0x6dacf20 'units'&gt;"; vendorID = 10; width = 01; }) </code></pre> <p>The units aren't printed. It says <code>"&lt;relationship fault: 0x6dacf20 'units'&gt;";</code></p> <p>Also, why is it printing the entire object when I only want units?</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.
 

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