Re: Core Data user-defined fields
In a similar situation, I defined one Property to represent both your Required (A, B, C) and User-defined properties, and wrote some business logic to ensure that the Required properties were always present. A variation would be that this user-interfacing Property is a dependent property, connecting to the appropriate A, B, C or User-defined properties in the model via custom accessors. Don’t forget +keyPathsForValuesAffecting. In the user interface, I put one pair of [+][-] buttons at the bottom left of the table to add rows, and another pair of [+][-] buttons at the top right of the table to add columns. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Core Data user-defined fields
I have a core data document-based app at the document level is a Core Data type called Library, with a one to many relationship to type Element. Element has a few properties but I want to allow the user to add others (of type string only at this point). So I have Element: String name String propA String propB String propC I think I need to add a one-to-many Set userProperties And a UserProperty type would have two properties: String propName String propValue When all this is displayed in a table bound with Core Data. I want a column for propD (so a UserProperty with propName = "propD"). How do I show the values since I have to go: element.userProperties, then get to propName = "propD" and then grab the propValue? Is it important to make sure all elements have this? I'd like users to be able to enter values in the table. Properties for propA, propB, propC are easy but I need to user to be able to create a column for propD and add values for some (or all) elements. Thanks, Trygve ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com