• 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
Hove to retrieve 'living' objects [CoreData / Bindings]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hove to retrieve 'living' objects [CoreData / Bindings]


  • Subject: Hove to retrieve 'living' objects [CoreData / Bindings]
  • From: Stefan <email@hidden>
  • Date: Tue, 6 Feb 2007 00:00:48 +0100

In my previous postings I mentioned a problem with a document, which
doesn't 'really' delete managed objects. Starting with a fresh document,
everything seems to be fine regarding the UI.

I still have a similar and likely related problem

Using the below code, I try to get an ordered list of records:

>>>
- (NSArray *)getSortedTransactions {
NSManagedObjectContext *moc = [transactionsArrayControllerOutlet managedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescription
entityForName:@"TAMTransaction" inManagedObjectContext:moc];
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
[request setEntity:entityDescription];


	NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]
		initWithKey:@"trDateCreated" ascending:YES];
	[request setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]];
	[sortDescriptor release];

	NSError *error = nil;
	NSArray *array = [moc executeFetchRequest:request error:&error];

	return array;
}
<<<

The actual objects returned are sorted. Unfortunately, I get deleted records too, which
don't appear in the app's GUI's bound NSTableView. This behaviour persists even if I
save the document and reload it again.


The 'delete' menu of the UI calls 'remove:' for the respective NSArrayController,
transactionsArrayControllerOutlet in this case.


Do I need to add a predicate, to just get the 'still living' objects returned?
_______________________________________________


Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Hove to retrieve 'living' objects [CoreData / Bindings] [SOLVED]
      • From: Stefan <email@hidden>
    • Re: Hove to retrieve 'living' objects [CoreData / Bindings]
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Re: MSSQL
  • Next by Date: Re: Customize NSAlert?
  • Previous by thread: Re: NSXMLDocument pretty printing
  • Next by thread: Re: Hove to retrieve 'living' objects [CoreData / Bindings]
  • Index(es):
    • Date
    • Thread