{
"$type": "site.standard.document",
"description": "I discovered an interesting feature in Interface Builder a few days ago. It seems that it can generate a scaffolding UI for you based on a CoreData model. It works like this: first you have to design a data model in XCode model editor (which you have to do anyway if you want to use Core Data; if you don’t, it won’t make sense to draw the model only to get the scaffold UI, it will be faster to make it yourself…). Let’s say you have a model like in this picture:\n\nTo generate the UI, you just grab an entity from the diagram and drag&drop it into a blank window in IB :) The trick is that you need to hold Alt while doing this, otherwise you’ll just drag the entity around the diagram. Then you need to choose one of 3 form versions and select the fields that you want in the form. And you get something like this:\n\nOr like this (this shows objects in a grid):\n\nOr this:\n\nOf course, most of the time you’ll need to make some corrections before you can use it, and it isn’t hard to make something like this yourself, but this can save you a few minutes. And it’s cool anyway :) What’s funny is that I’ve just finished Aaron Hillegass’s book and I’ve read all the available chapters from the Rubycocoa book, and none of them mentioned this feature even once… I learned about this from a Wikipedia entry for Core Data.",
"path": "/2008/11/20/generating-scaffold-interfaces-in-cocoa/",
"publishedAt": "2008-11-20T21:13:19Z",
"site": "at://did:plc:oio4hkxaop4ao4wz2pp3f4cr/site.standard.publication/3mn5mackuba26",
"tags": [
"Cocoa",
"Mac"
],
"textContent": "I discovered an interesting feature in Interface Builder a few days ago. It seems that it can generate a scaffolding UI for you based on a CoreData model. It works like this: first you have to design a data model in XCode model editor (which you have to do anyway if you want to use Core Data; if you don’t, it won’t make sense to draw the model only to get the scaffold UI, it will be faster to make it yourself…). Let’s say you have a model like in this picture:\n\nTo generate the UI, you just grab an entity from the diagram and drag&drop it into a blank window in IB :) The trick is that you need to hold Alt while doing this, otherwise you’ll just drag the entity around the diagram. Then you need to choose one of 3 form versions and select the fields that you want in the form. And you get something like this:\n\nOr like this (this shows objects in a grid):\n\nOr this:\n\nOf course, most of the time you’ll need to make some corrections before you can use it, and it isn’t hard to make something like this yourself, but this can save you a few minutes. And it’s cool anyway :) What’s funny is that I’ve just finished Aaron Hillegass’s book and I’ve read all the available chapters from the Rubycocoa book, and none of them mentioned this feature even once… I learned about this from a Wikipedia entry for Core Data.",
"title": "Generating scaffold interfaces in Cocoa",
"updatedAt": "2025-06-30T01:49:16Z"
}