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

Re: Hove to retrieve 'living' objects [CoreData / Bindings] [SOLVED]


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


Am 06.02.2007 um 00:00 schrieb Stefan:

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

>>>
- (NSArray *)getSortedTransactions {
NSManagedObjectContext *moc = [transactionsArrayControllerOutlet managedObjectContext];
...
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.

I retrieved managed objects using a bad starting point. This one works as better:


>>>
// First create a sort descriptor, which sorts 'trDateCreated'
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]
initWithKey:@"trDateCreated" ascending:YES];

// Then ask the NSArrayController to use this description
[transactionsArrayControllerOutlet setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]];


	// finally, get the sorted objects
	return [transactionsArrayControllerOutlet arrangedObjects];
<<<
_______________________________________________

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


References: 
 >Hove to retrieve 'living' objects [CoreData / Bindings] (From: Stefan <email@hidden>)

  • Prev by Date: Re: Hove to retrieve 'living' objects [CoreData / Bindings]
  • Next by Date: Passing parameter to NSValueTransformer
  • Previous by thread: Re: Hove to retrieve 'living' objects [CoreData / Bindings]
  • Next by thread: Permanent file/folder handle
  • Index(es):
    • Date
    • Thread