Welcome, Guest
Username Password: Remember me

One shot scaffolding of all core data entities in a model
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: One shot scaffolding of all core data entities in a model

One shot scaffolding of all core data entities in a model 1 year, 6 months ago #1

Hi!

Was looking back at some of my code in Ruby/Rails and remembered how nice the automatic scaffolding (www.tutorialspoint.com/ruby-on-rails/rails-scaffolding.htm) from data model entities was. In some simple steps a data entry from can be created in Rails which is something Sensible Cocoa can do easily.
Maybe the choice of choosing tableviews or tab bars to list entities would be nice.

Thanks!
  • codebonbon
  • OFFLINE
  • Expert Boarder
  • Posts: 147
  • Karma: 7
Last Edit: 1 year, 6 months ago by codebonbon.

Re: One shot scaffolding of all core data entities in a model 1 year, 6 months ago #2

Thanks a lot for your ideas!

Actually just creating a class definition of the entity with the autoGeneratePropertyDefinitions option set to TRUE automatically scaffolds your entity's attributes and generates cells that correctly correspond to the attributes' types. It even detects if your attributes are Optional/Required and applies validation checks automatically. Here is a code sample of how this class definition declaration looks like:

 
SCClassDefinition *myClassDef =
[SCClassDefinition definitionWithEntityName:myEntity withManagedObjectContext:managedObjectContext
autoGeneratePropertyDefinitions:TRUE];
 


So it's practically just one line of code. Now remember the above is just the entity definition, so to generate the actual object cells, you need another single line of code:

 
SCObjectSection *objectSection =
[sectionWithHeaderTitle:nil withBoundObject:myObject withClassDefinition:myClassDef];
 


Please tell me if this was what you had in mind.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
  • Page:
  • 1
Time to create page: 0.69 seconds