Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create NSManagedObject subclass not generating property after updating to Xcode 6.0

Tags:

xcode

After updating to Xcode Version 6.0 (6A313), when I add a new attribute to my xcdatamodeld entry, "Create NSManagedObject subclass" is not adding the new property to the generated header file. This works fine after closing Xcode 6, and then running Version 5.1.1 (5B1008). I repeated this process a couple of times with the same results. Do I need to do something to allow a new Xcode version to properly manage my data models, or recreate them, or is this possibly just a bug with the new Xcode?

Here are the specific steps I took:
1. Open DataModel.xcdatamodeld in Xcode 6.0 (GM Seed).
2. Select correct entity
3. Click + to add new attribute
4. Enter name and selected Boolean type for new attribute
5. Editor->Create NSManagedObject subclass
6. Ensure proper data model is checked, click next
7. Ensure correct entity is checked, click next
8. Choose location to save (using root project folder), select Create
9. Choose "Replace" in dialogue box
10. Look for variable in generated header file. Variable not present.
11. Close Xcode6
12. Repeat steps 1-10 in Xcode 5.1.1, worked correctly
13. Repeated this process twice to verify same results

Thanks for any help!

like image 207
dcep1 Avatar asked Sep 15 '14 17:09

dcep1


1 Answers

Ok, I figured out a workaround but it would appear this is a bug.

For all the entities you want to regenerate, remove the existing files from disk try Editor->Create NSManagedObject subclass and select those classes that you have removed from disk.

The files that don't currently exist are regenerated. This fixed the issue for me.

like image 166
d0n13 Avatar answered Oct 04 '22 11:10

d0n13