• 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
Re: CoreData Bug? (SQLite vs XML)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData Bug? (SQLite vs XML)


  • Subject: Re: CoreData Bug? (SQLite vs XML)
  • From: Milen Dzhumerov <email@hidden>
  • Date: Sun, 13 Sep 2009 18:07:10 +0100


On 13 Sep 2009, at 17:45, mmalc Crawford wrote:


On Sep 13, 2009, at 9:14 AM, Milen Dzhumerov wrote:

-(void)awakeFromFetch
{
	for(id base in [self relationship])
		Log(@"%@", base);
	...
}

awakeFromFetch
[...]
Important:  Subclasses must invoke super’s implementation before
performing their own initialization.

I just moved the snippet below the super call and changed it to:

Log(@"------------------------------");
Log(@"(self title=%@) awakeFromFetch", [smart title]);
NSSet* relationship = [smart sourceContainers];
Log(@"Class=%@, non-nil=%@", NSStringFromClass([relationship class]), relationship ? @"YES" : @"NO");
for(EBContainer* source in [smart sourceContainers])
Log(@"(self title=%@) source title=%@", [smart title], [source title]);


In what sense is the relationship not restored properly?  Are you
simply seeing faults?

mmalc

The relationship shrinks (ie the NSSet contains less objects after fetch than it did on save). The example below shows the following loss:
- AllSmart loses the pointer to Reddit
- RedditOne loses the pointer to Reddit


On application quit (after context save):
2009-09-13 17:58:51.213 EventBox[19469:10b] ------------------------------
2009-09-13 17:58:51.214 EventBox[19469:10b] (self title=RedditTwo) onQuit
2009-09-13 17:58:51.214 EventBox[19469:10b] Class=_NSFaultingMutableSet, non-nil=YES
2009-09-13 17:58:51.214 EventBox[19469:10b] (self title=RedditTwo) source title=Reddit
2009-09-13 17:58:51.215 EventBox[19469:10b] ------------------------------
2009-09-13 17:58:51.215 EventBox[19469:10b] (self title=AllSmart) onQuit
2009-09-13 17:58:51.215 EventBox[19469:10b] Class=_NSFaultingMutableSet, non-nil=YES
2009-09-13 17:58:51.216 EventBox[19469:10b] (self title=AllSmart) source title=Reddit
2009-09-13 17:58:51.216 EventBox[19469:10b] (self title=AllSmart) source title=Feeds
2009-09-13 17:58:51.216 EventBox[19469:10b] ------------------------------
2009-09-13 17:58:51.217 EventBox[19469:10b] (self title=RedditOne) onQuit
2009-09-13 17:58:51.217 EventBox[19469:10b] Class=_NSFaultingMutableSet, non-nil=YES
2009-09-13 17:58:51.217 EventBox[19469:10b] (self title=RedditOne) source title=Reddit


On awake from fetch:
2009-09-13 17:59:56.313 EventBox[19475:10b] ------------------------------
2009-09-13 17:59:56.313 EventBox[19475:10b] (self title=AllSmart) awakeFromFetch
2009-09-13 17:59:56.314 EventBox[19475:10b] Class=_NSFaultingMutableSet, non-nil=YES
2009-09-13 17:59:56.314 EventBox[19475:10b] (self title=AllSmart) source title=Feeds
2009-09-13 17:59:56.315 EventBox[19475:10b] ------------------------------
2009-09-13 17:59:56.316 EventBox[19475:10b] (self title=RedditOne) awakeFromFetch
2009-09-13 17:59:56.316 EventBox[19475:10b] Class=_NSFaultingMutableSet, non-nil=YES
2009-09-13 17:59:56.336 EventBox[19475:10b] ------------------------------
2009-09-13 17:59:56.336 EventBox[19475:10b] (self title=RedditTwo) awakeFromFetch
2009-09-13 17:59:56.337 EventBox[19475:10b] Class=_NSFaultingMutableSet, non-nil=YES
2009-09-13 17:59:56.337 EventBox[19475:10b] (self title=RedditTwo) source title=Reddit


Thanks,
M_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >CoreData Bug? (SQLite vs XML) (From: Milen Dzhumerov <email@hidden>)
 >Re: CoreData Bug? (SQLite vs XML) (From: mmalc Crawford <email@hidden>)

  • Prev by Date: Re: CoreData Bug? (SQLite vs XML)
  • Next by Date: Bug: CalendarStore framework adding events with alarms with email address.
  • Previous by thread: Re: CoreData Bug? (SQLite vs XML)
  • Next by thread: re: CoreData Bug? (SQLite vs XML)
  • Index(es):
    • Date
    • Thread