• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data entities not getting loaded into MOC when opening file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data entities not getting loaded into MOC when opening file


  • Subject: Core Data entities not getting loaded into MOC when opening file
  • From: Andrew Madsen <email@hidden>
  • Date: Mon, 10 Jul 2006 00:50:10 -0600

I've got a document-based core data app with a relatively simple data model. I'm seeing a problem where some entities get loaded properly into the MOC when I open an XML file saved by the app. However, others don't get loaded. They are visible in the XML file, but the result of a [managedObjectModel registeredObjects] contains the following:

(entity: stationInfo; id: 0x3aea20 <x-coredata://8A66BB3D- DF6F-45D1-8348-0E404838F6C2/stationInfo/p103> ; data: <fault>)

The XML file has this:

<object type="STATIONINFO" id="z103">
<attribute name="name" type="string">andrew</attribute>
<attribute name="address" type="string">123 green street</ attribute>
<attribute name="phone" type="string">123-4567</attribute>
</object>



stationInfo is the main entity I'm concerned about that doesn't get loaded (the others are related entities). There is only one stationInfo entity per MyDocument instance, and it is one of the instance variables of MyDocument (in addition to having a NSObjectController controlling it). If I do something like NSLog(@"% @", [self myStationInfo]) within MyDocument, the output of the NSLog function is <NULL>.


I can't figure out what would MyDocument to load some of the entities in the XML file, but not others. I have overridden one relevant method for debugging purposes only:

- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *) typeName error:(NSError **)outError
{
NSLog(@"read from a URL: %@ of type: %@", absoluteURL, typeName);
return [super readFromURL: absoluteURL ofType: typeName error: outError];
}


Any ideas?

Thanks!
Andrew Madsen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Core Data entities not getting loaded into MOC when opening file
      • From: Chris Hanson <email@hidden>
  • Prev by Date: RE: where have all the IVARS gone? (long time passing...)
  • Next by Date: Re: where have all the IVARS gone? (long time passing...)
  • Previous by thread: Creating Transparent Window on Dock Icon
  • Next by thread: Re: Core Data entities not getting loaded into MOC when opening file
  • Index(es):
    • Date
    • Thread