views:

532

answers:

2

I am trying to add a data model to an existing Xcode project. I am doing so by...

File -> Add Files... -> iPhone OS/Resource/Data Model -> next -> (name the model) -> Next -> Finish.

What I get is an empty blue folder named mymodelname.xcdtamodel and no editor.

I tried creating a new windows based (use core data for storage checked) project with the same name as the project I am working on. This properly creates the .xcdatamodel file. I thought I could then add this .xcdatamodel file to my real project, but when I do it shows up as a folder with 2 files in it, none of which will give me an editor.

I am stumped. What am I doing wrong? Any ideas for a workaround?

Thanks, John

A: 

My guess is that for some reason the Launch Services extension database didn't get rebuilt when you installed Xcode, so the system doesn't recognize .xcdatamodel packages as such. Google for "lsregister -kill" to rebuild the LS database.

cdespinosa
Thanks for the suggestion after a google search as you suggested I ran the following in terminal that completed successfully.../System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister \ -kill -r -domain local -domain system -domain userNo sure that actually does what you suggested but after running it my problem continues. Any other suggestions?
A: 

I was able to get this working by doing a "Get Info" on the file inside XCode. Then changing the File Type to "wrapper.xcdatamodel"

solidline