On 7 Feb 2012, at 2:48 PM, Laurent Daudelin wrote:

> I have a very simple model with a table and some attributes in it. For some 
> reason, I have an NSDate attribute that I want to use for a sort descriptor. 
> The problem I'm having is that when I have my NSFetchedResultsController 
> fetches the database, the NSDate attribute of all my fetched objects is 
> always the current date, or now. When I look at the table in the database 
> directly, I see there are different values for this attribute. There isn't 
> any trick or manipulation behind the scene, my subclass of NSManagedObject 
> just declares the properties that are in the table, nothing more, nothing 
> less. I then added an NSString and basically the same thing is happening: 
> when I look at the attribute in the table in the database, there are values 
> for this string but when I fetch with my NSFetchedResultsController, all the 
> strings are nil.

iOS or Mac? What project template did you start with? 

Are you building the Core Data stack yourself? If Mac, are you using a 
persistent document?

How are you initializing the fetched-results controller?

Have you verified that all the objects coming back from your fetches have 
different objectIDs?

You say your managed-object subclass declares properties for all the entity's 
(I think you mean "entity" when you say "table") attributes, but did you also 
specify @dynamic for the properties?

Try instantiating a new project (for whatever your platform is) that you'll 
throw away, so you can see how the various setups are done. An iOS 
master-detail application that uses Core Data will demonstrate both the 
Core-Data stack initialization and how to set up the fetched-results controller.

        — F


_______________________________________________

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