Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate code for core data attributes in xcode 4

In xcode 3 there was a helpful feature in the data model builder where you could highlight some attributes/relationships in an entity, right-click, and choose to copy method and property declarations to the clipboard. (You could choose if you wanted objective-c 2.0 property declarations also). Then you could paste them into your NSManagedObject subclass.

I see how you can still generate the entire class file; but this isn't helpful if you are adding attributes to an existing entity. Have they removed this feature from xcode 4? I used it all the time!

like image 793
GendoIkari Avatar asked Mar 16 '11 15:03

GendoIkari


People also ask

How do I create a Core Data model?

Add a Core Data Model to an Existing ProjectChoose File > New > File and select the iOS platform tab. Scroll down to the Core Data section, select Data Model, and click Next. Name your model file, select its group and targets, and click Create.

How do I enable Core Data in Xcode?

Get our help adding Core Data to your project So, with your existing project open, create a new project in Xcode (⇧⌘N) and select a Single View App, you can call it whatever you like as we'll be deleting it when we're done. You'll see the “Use Core Data” checkbox on the project options screen, make sure it is checked.

What is attribute in Core Data?

You can think of attributes as the columns of a table in a database. Attributes store the values of a Core Data record. There are several types of attributes, such as String, Date, Integer, Float, and Boolean.


2 Answers

See the Core Data Model Editor Help: Creating Objective-C Accessor Methods for a Managed Object

like image 75
Vipera Berus Avatar answered Oct 07 '22 01:10

Vipera Berus


You may find MoGenerator useful.

like image 36
Michal K. Avatar answered Oct 06 '22 23:10

Michal K.