> On Feb 14, 2017, at 6:50 PM, Daryle Walker <[email protected]> wrote:
> 
> Looking at my code again, I had a massive brain-fart. I created all the data 
> objects with local “let,” but forgot to assign the top-level object to my 
> document’s data property.
> 
> Once I did that, the window doesn’t show up at all due to a different problem:
> 
>> 2017-02-14 18:43:00.018210 XNW[13100:1621112] Cannot create NSArray from 
>> object Relationship 'header' on managed object (0x608000085460) 
>> <InternetMessages.RawMessage: 0x608000085460> (entity: Message; id: 
>> 0x600000031300 <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/Message/p2 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/Message/p2>> ; data: {
>>    body = "Is this an accurate test?";
>>    header =     (
>>        "0x6000000312a0 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/HeaderField/p3 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/HeaderField/p3>>",
>>        "0x600000031140 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/HeaderField/p1 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/HeaderField/p1>>"
>>    );
>> }) with objects {(
>>    <InternetMessages.RawHeaderField: 0x608000083390> (entity: HeaderField; 
>> id: 0x6000000312a0 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/HeaderField/p3 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/HeaderField/p3>> ; data: {
>>    body = World;
>>    message = "0x600000031300 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/Message/p2 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/Message/p2>>";
>>    name = Hi;
>> }),
>>    <InternetMessages.RawHeaderField: 0x608000083750> (entity: HeaderField; 
>> id: 0x600000031140 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/HeaderField/p1 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/HeaderField/p1>> ; data: {
>>    body = planet;
>>    message = "0x600000031300 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/Message/p2 
>> <x-coredata://B63E5B93-8B0A-49C1-BC6A-D4C948A2CA61/Message/p2>>";
>>    name = Bye;
>> })
>> )} of class _NSFaultingMutableOrderedSet
> 
> This error came up twice on app start. It came up once more when I tried 
> clicking on the app icon.

I used the classic method of performing a web-search on “Cannot create NSArray 
from object Relationship”. I got a page 
<http://stackoverflow.com/questions/15078679/binding-an-ordered-relationship-with-an-nsarraycontroller>.
 I used the marked answer. I couldn’t find the page sited (nor the GitHub 
project) except through a web-archive site. It works, as far as reading is 
concerned, but I don’t know if it’ll write changes too.

Is this still needed? I’m surprised that NSArrayController supports NSArray and 
NSSet, but not (yet?) NSOrderedSet. This seems like a major bug. It’s like the 
old solution, taint your data with an order index field, was never updated 
among Apple projects, so no one noticed that the NSOrderedSet code didn’t 
actually work! Maybe I’ll file a bug after some sleep.

[The “come up twice” bug was from my last run having two documents open, 
somehow. I couldn’t see since the bug were jamming windows being shown. I 
suspected it when I added Core Data undo, but didn’t turn it off during object 
load, leading to TWO save-before-closing alerts!]

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to