Re: NSPropertyDescription userInfo - SOLVED
Re: NSPropertyDescription userInfo - SOLVED
- Subject: Re: NSPropertyDescription userInfo - SOLVED
- From: "Steve@DotMac" <email@hidden>
- Date: Sat, 5 Nov 2005 11:22:59 -0600
Jim;
THANKS!! In my reading so far the 'localization dictionary' appears
to be something that Cocoa will use for its own.
I don't see a way to invoke the dictionary on my behalf when I need
it...
In any case, a localization dictionary doesn't solve my other issue
-- flagging some attributes for visibility in tableViews.
So with your help/encouragement I finally have the following syntax:
NSEntityDescription * x = [[[[managedObjectContext
persistentStoreCoordinator] managedObjectModel] entitiesByName]
objectForKey:@"entityX"];
NSString * friendlyName = [[[[x propertiesByName]
objectForKey:@"attributeName"] userInfo]
objectForKey:@"userInfoKeyForFriendlyName"];
NSString * isVisible = [[[[x propertiesByName]
objectForKey:@"attributeName"] userInfo]
objectForKey:@"userInfoKeyForVisibility"];
Now I can have 'friendly' names where-ever and whenever I need them.
Since I can -setUserInfo before I bind the context to a persistent
store, I could read in a localized .string file to make this work
internationally...
On the same note I can dynamically allow/disallow visibility, for
example, based on the license, for example....
THANK-YOU for your help!
Steve
On Nov 5, 2005, at 9:56 AM, Jim Correia wrote:
On Nov 5, 2005, at 10:48 AM, Steve@DotMac wrote:
I'm not sure what you mean by 'localization dictionary' (string
files? responses from NSLocale? other?).
No such term is found in the Apple Documentation...
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdMOM.html#//apple_ref/doc/uid/TP40002328-SW3
http://developer.apple.com/documentation/Cocoa/Reference/
CoreData_ObjC/Classes/NSManagedObjectModel.html#//apple_ref/doc/uid/
TP30001174-BCIDJGFI
Also what do you mean '... attached directly.."?
In the first reference it mentions a naming convention and implies
that they should be associated automatically. Either I am
misinterpreting what it says, I have made a mistake, or this
feature is broken.
HOW do I get the 'NSPropertyDescription' in the message
[NSPropertyDescription userInfo]?
What exactly creates an NSPropertyDescription as its response?
I thought, and have tried, to get something along the lines of
[[[...entity] propertyDescriptionFor:@"attributeName"] userInfo]...
An NSPropertyDescription is the base class of
NSAttributeDescription and NSRelationshipDescription.
When you get an attribute description by name from your model, you
already have one.
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden