Can not create a new Model version - ios

I have an old project (made for iOS4).
I am upgrading it now and try to add a model version to my Core Data model.
When I am trying to add the version from Xcode menu, it simply create a new version of the model and does not create the .modeld package.
I tried to change it manually but it douses many problems and the migration fails.
Why it won't let me create the .modeld file ?
Any idea how can I overcome this problem ?
Here is the image from Xcode navigator -
While it should be -
Thanks a lot

Xcode will always create a .xcdatamodel file for new model
versions. .xcdatamodeld is a file package that groups versions
of the model.
There's a workaround that you can do:
Create a new Data Model (File > New > File... > Core Data > Data Model) and give the model the same name as your current version (e.g. jerusalemBiblicalZoo).
Reveal the created jerusalemBiblicalZoo.xcdatamodeld on Finder
Right click on the file and select Show Package Contents so you will see a .xcdatamodel file there.
Override it with your old .xcdatamodel file. Then you will have the new data model structure using your old single model version.

if you want to create new version for coreData, don't recreate xcdatamodel.Click jerusalemBiblicalZoo.xcdatamodel and go to Editor->Add Model Version select base model and go on.

Related

How to create a template dashbord in tableu?

I have a Dashboard in tableau that I want to replicate it with another database that has the same columns/pills!
is it possible to do that?
The best way would be to open the "template dashboard", add the new data source, then go to menu DATA => Replace data source and change the old data source to the new data source.
At this point close the old data source.
The fastest way, but this might not work, is to open the .twb file of the dashboard with Notepad and replace the old database name with the new one...of course something could be broke.
If you have a .twbx file you can open it with WinZip, WinRar, ... and find the .twb file inside.
Possibly you could try 2 Options:
Take a copy of your template. In the Data Source tab, go to Connections -> Edit Connection to point it to the new data source.
In the template, create a new data source. Replace the Old data source with the new one by Data -> Replace Data Source.
For the formulas and filters to reflect on the new data source, make sure the field names and data types are the same as the old data source.
Kindly note: Editing the XML is unsupported by Tableau! Create a copy of your original workbook before attempting any XML editing, as this could potentially corrupt your workbook.

xcode8 header not found using NSManagedObject subclass in CoreData

Thanks for having a look :)
I am using xcode 8.2.1 and the language is obj-c.
I simply created two entities(Photo and Photographer) and after I did editor - create NSManagedObject Subclass there went error in the files generated.
One is in Photo+CoreDataClass.m saying "Photographer.h file not found".
Another one is in Photographer+CoreDataClass.m at the line saying "Photo.h file not found".
All the files that were generated were:
Photographer+CoreDataClass.h/m,
Photo+CoreDataClass.h/m
Photographer+CoreDataProperties.h/m
Photo+CoreDataProperties.h/m
The tools version minimum is Xcode 7.3 and codegen is None/Manual
Could anyone tell me how to fix this?
Ps, the entity's relationship is that one Photographer to-many Photo, and Photo to-one Photographer
Just rename your files
Photographer+CoreDataClass.h/m,
to
Photographer.h/m
and
Photo+CoreDataClass.h/m
to
Photo.h/m
then copy the properties from the other two classes into the renamed ones then remove them.
I got rid of this error by setting Module to empty for the Class section after you select .xcmodeld file

"In the uniqueness constraints attribute for entity, comma is not valid property" in Coredata Xcode 8

I created a database with Core Data on iOS. I initially set up a unique constraint in my Conversation entity. However, after removing it, I was getting an error: "In the uniqueness constraints attribute for entity Conversation, comma is not a valid property".
I looked at every field in my DataModel.xcdatamodeld but could not find any solution.
If you have set any constrains (using Attribute name) previously for your Entity and later if you would have deleted/renamed that particular attribute, then it will throw such error. You need to rename or delete that constraint property by double clicking it with respect to your data model business flow.
Refer screenshot for reference.
I had the same issue with Xcode 8.1. I did not want to delete all the many attributes painfully set up on all 6 of my entities, and found another solution. Let's assume your model file is called "foobar.xcdatamodeld".
Edit the XML directly in the model. For this, you need to get to the file 'contents' inside the model file. The path to it is: foobar.xcdatamodeld/foobar.xcdatamodel/contents. To get to it in Finder, control-click on the "xcdatamodeld" package to "Show Package Contents", then again on the "xcdatamodel" package. You can then drag the file 'Contents' into your text editor of choice. You will see the constraints appear as follows in the XML:
<uniquenessConstraints>
<uniquenessConstraint>
<constraint value="property_name"/>
</uniquenessConstraint>
</uniquenessConstraints>
You can edit "property_name" to match the new value, or remove the constraints altogether.
Once edited, try to clean and recompile. In my case, the error was still there, so I had to do a little "renaming dance" with Xcode. I deleted the model from the Xcode project, then renamed the model file to a different name (including the "xcdatamodel" file inside the "xcdatamodeld" file), and added it back to Xcode. I repeated that again with the old name again so I was back to the initial name.
Its looks like a bug in Xcode 8. I have deleted all the attributes from the entity, cleaned the project and then added the attributes again. After that, the error was gone. Maybe this will help someone.
I inspected the XML file and noted that the "comma,separated,properties" was in the XML. I used Product->Clean (command+shift+K) to clean the project. Cleaning in of itself didn't help. I then tried File->Save (command+S).
File->save updated the XML and cleared up the situation for me.

Code-first migration is not recognising column drop

I have 2 projects (one called Biz and the other WebAdmin which is the startup project).
I delete a property from the biz project model and call add-migration. It creates the migration CS in WebAdmin but doesn't create anything for biz project changes.
I add in a dropcolumn statement by hand DropColumn("Account", "TestID") but this doesn't not get applied to the model that 'biz' is referencing.
How can I get the dropcolumn to work?
Ensure you select the right project target in the Package Manager console.

MVC updating .edmx files (.msl, .csdl, .ssdl)

I have 3 .edmx files (.msl, .csdl, .ssdl) in my root project directory where the web.config is. Why are these not updating when I do a 'update model from database'?
I have to manually add the new fields to these files...
.msl, .csdl and .ssdl are result of .edmx compilation, if you do not embedd them into assembly check that "EntityDeploy" is selected for "Build Action" in .edmx file properties (in Solution Explorer) and "Copy to Output Directory" is selected for "Metadata Artifact Processing" in model properties (in model designer), update your model and rebuild solution. After that they will be copied to bin\Debug subfolder.
BTW, you could select "Embedd into Output Assembly", update connection string, remove references to these files from solution and do not care about them anymore.

Resources