ios - Building a flexible editing form for attributes of an NSManagedObject subclass -


i have nsmanagedobject subclass 30 different attributes. in app, user should able edit (most of) attributes in table. there 3 attributes automatically set based on values of other combinations of attributes.

example:

@implementation mynsmanagedobjectsubclass @dynamic one; // edited user in form @dynamic two; // edited user in form @dynamic three; // edited user in form @dynamic four; // edited user in form @dynamic five; // edited user in form @dynamic icon; // automatically set based values of above 5 items @end 

i have 2 questions:

1) regarding building form in table view user can use edit objects: other hard-coding content of table view, how can table view build cells attributes needs show? current idea use this method iterate through properties of object , have binary "display mask" table view can use determine whether or not should display cell particular item. there better way?

2) regarding automatically setting 1 attribute based value of others: how? think kvo comes play here (i need icon attribute update on screen 1 of attributes depends on changes) i'm new core data , not sure read whether can add kvo nsmanagedobject subclasses.

ad 2 - concur wain kvo can useful. however, standard way override setters in custom managed object classes.

ad 1 - iterating through attributes nice abstraction, doubt save work. point out, still have create "binary display mask" determine attribute make editable. seems pretty messy once attribute added somewhere...

i have had experience in kind of situation (40 entities, 100s of attributes) simple "mapping" plist can used purpose. entering attributes plist (in desired order) , adding other properties fast , simple - , flexible solution should change.

you can still iterate through attributes via nsentitydescription generate initial plist.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -