I'm using Xcode 4.2 and I'm trying to use Core Data. Upon clicking the .xcdatamodeld file I see a strange view instead of the Data Model Editor View.
I have reinstalled Xcode 4.2 and have even created a starter project from scratch with Core Data Enabled but the issue persists. When I create a Data Model using new file --> Data Model. It is not being recognized as a DataModel. Ctrl+Click --> 'Open As' only displays a "Preview" option. I compared my basic project with that created on a different machine (where everything works fine). A directory diff reveals :
The Foos.xcdatamodeld file was placed under the "Copy Bundle Resources" section of the project's Build Phase instead of being under the "Compile Sources" section. I moved this file to the "Compile Sources" section but the data model editor still doesn't display.
The Foos/Foos.xcdatamodeld/.xccurrentversion file in the working project looked like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>Foos.xcdatamodel</string>
</dict>
</plist>
while in the non-functional one it was
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
The only other difference I noticed was that the working version had the following in the project.pbxproj file
/* Begin XCVersionGroup section */
831B12C114A7F73600524A33 /* Foos.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
831B12C214A7F73600524A33 /* Foos.xcdatamodel */,
);
currentVersion = 831B12C214A7F73600524A33 /* Foos.xcdatamodel */;
path = Foos.xcdatamodeld;
sourceTree = "";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
while the broken one did not have this entry.
I did a directory compare of /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates on my two machines and the templates are identical.
So I'm wondering what part of Xcode is causing the above differences on my primary dev machine. Any suggestions on things to try or what might be causing this issue?
I ran into a similar issue. The problem was the projects directory structure and how it was configured in XCode.
More details here: XCode Cant' Edit CoreData Model
I also ran into this.
I was finally able to get xcode 4.6.3 to restore the interactive editor by opening the .xcdatamodeld in my project and changing the File Type (in the file inspector) from Versioned Core Data Model to Core Data Model. I was able to change it back to Versioned Core Data Model, later, and things kept working.
I had the same problem, but by creating another user account on my Mac, I was able to create a project with Core Data where the editor opens normally. It appeared my user profile was corrupt and it couldn't be resolved by reinstalling Xcode.
When creating a new data model, go to Editor > Add Model Version
That fixed it for me! :)
I solved the problem by opening the package contents of xcdatamodeld, dragging out the file inside with the same name and using it instead, thanks to this answer.
Related
I am using Xamarin Forms. I was facing one weird issue from the past two days. First I have created App with assets catalog and not included a key for "CFBundleIconName". Then after just a few minutes, I got an error like
A value for the Info.plist key 'CFBundleIconName' is missing in the bundle "xxx".
Then after I have tried with assets catalog and removed above key from info.plist file. Then I got an error like
Missing Asset Catalog - Your app is missing the asset catalog file
If I am removing below lines from a plist file then getting 120X120 icon file missing.
<key>XSAppIconAssets</key>
<string>Media.xcassets\AppIcons.appiconset</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconName</key>
<string>icon</string>
<key>CFBundleIconFiles</key>
<array>
<string>icon-20#2x.png</string>
<string>icon-20#3x.png</string>
<string>icon-29#2x.png</string>
<string>icon-29#3x.png</string>
<string>icon-40#2x.png</string>
<string>icon-40#3x.png</string>
<string>icon-60#2x.png</string>
<string>icon-60#3x.png</string>
</array>
</dict>
</dict>
Are the above lines are necessary to include in plist file? What other things are necessary to include in plist file.
And My project structure is :
What is wrong with my code? How can I add all files and assets?
Any idea?
Delete all images and those lines from the info.plist.
Your Info.Plist should have the following lines:
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>XSLaunchImageAssets</key>
<string>Assets.xcassets/LaunchImage.launchimage</string>
Add all the required icons to Asset Catalogs/Media
I want to add a plist config for nativescript project. But I can't find the way to add the notes extension.
Are you looking for your plist file? If so, check App_Resources/ios. You can edit it there.
When Xcode creates new textual file, it contains such header:
//
// AppDelegate.swift
// application name
//
// Created by Developer Name on 25.07.17.
// Copyright © 2017 company. All rights reserved.
//
Application name and company values gives from project when developer's name from macOS account
Can I set custom developer's name for project in Xcode directly, without changing or setting up OS account?
It needed for example when one mac uses for work and home projects. I want to set my real name for work projects and pen name for home.
Thanks for Mark's comment I found answer
For set custom project developer's name info.plist file must be edited
Just add row Copyright (human-readable) (source code key is NSHumanReadableCopyright) and enter needed name:
Or directly in source code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSHumanReadableCopyright</key> <!-- developer name key -->
<string>Developer Name</string> <!-- developer name value -->
<!-- ... and further ... -->
Is it possible in the templateInfo.plist to change where a framework is loaded from?
I can't seem to find how to change it with the framework also being installed to the iPhoneOS#.#SDK and iPhoneSimulatorOS#.#SDK System/Library/Frameworks directories.
I have my framework loading from those directories where it is installed but I have a request to change the template to load the framework from another install location to minimize disk space.
Example plist xml:
<key>Frameworks</key>
<array>
<string>MobileCoreServices</string>
<string>My_New_SDK</string>
<string>AddressBook</string>
<string>AddressBookUI</string>
<string>AudioToolbox</string>
<string>AVFoundation</string>
<string>CFNetwork</string>
<string>CoreGraphics</string>
<string>CoreLocation</string>
<string>CoreTelephony</string>
<string>ExternalAccessory</string>
<string>Foundation</string>
<string>MapKit</string>
<string>MessageUI</string>
<string>MediaPlayer</string>
<string>Security</string>
<string>SystemConfiguration</string>
<string>QuartzCore</string>
<string>UIKit</string>
</array>
If you remove the My_New_SDK from the frameworks list of the target area of the template, you can create a Node in the template for the framework and specify the absolute path in that node. Do not forget to add the node to the Nodes array in the template plist
<key>MY_New_SDK.framework</key>
<dict>
<key>Path</key>
<string>/PATH_TO_FRAMEWORK/My_New_SDK.framework</string>
<key>PathType</key>
<string>Absolute</string>
</dict>
When editing plist files in Xcode, it can detect the type of plist and show human-readable strings to make it more easy to edit the file. The Info.plist, for example.
Thanks to This question, I found the (or a) place where it stores that structure definition, as InfoPlistStructDefs.xcodeplugin. If I put my own file in there, however, nothing interesting happens. That is, it doesn't show up in the list of possible property list types.
So does anybody know how to make Xcode or the external property list editor application recognize a custom plist structure definition?
I found the answer. I have to put it in
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/
FYI, PlistEdit Pro also provides a custom interface for creating and editing plist structure definitions, if you don't want to have to mess around with XML.