Re: 10.9 Bug in Core Data : Entity Description methods
Re: 10.9 Bug in Core Data : Entity Description methods
- Subject: Re: 10.9 Bug in Core Data : Entity Description methods
- From: Mike Abdullah <email@hidden>
- Date: Thu, 31 Oct 2013 15:51:15 +0000
Sounds to me like the dictionary is somehow internally set up to use pointer equality. For the literal syntax, perhaps that happens to work out as Core Data is using the same underlying string objects?
An interesting test would be to first make a copy of the dictionary (both using -copy and +dictionaryWithDictionary:). How does that affect things?
On 31 Oct 2013, at 14:17, Jerry Krinock <email@hidden> wrote:
> When you send -objectForKey: to the dictionary returned by -[NSManagedObjectModel entitiesByName], -objectForKey: returns the expected result if the passed-in key is a literal constant such as @“foo”. But if you instead pass in a local variable whose value is constructed to be equal to @“foo”, -objectForKey: returns nil in Mac OS X 10.9.
>
> In Mac OS X 10.8, it returns the expected value, whether the key is a constant or not.
>
> Method +[NSEntityDescription entityForName:inManagedObjectContext:] exhibits similar misbehavior.
>
> I posted this a few days ago on Developer Forums. For more info or discussion, go there…
>
> https://devforums.apple.com/message/912837#912837
>
> I’ll file a bug if no one from here can explain it either.
>
> Jerry
>
>
> _______________________________________________
>
> 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
_______________________________________________
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