Difference between "Keep Xcode Version" vs. "Use Version on Disk"? - ios

When I use git, I usually change between branches and my iOSBaseSDK.xcworkspace file is modified.
When this happen my Xcode shows the following alert:
The file "YourProject.xcworkspace" has been modified by another application
The file is located at "LOCATION". Do you want to keep the Xcode version, or use the version on disk?
Keep Xcode Version
Use Version on Disk
I don't understand the meaning of the two options, as they relate to the git branches I am switching between.
What is the difference between Keep Xcode Version and Use Version on Disk?

Let's have this assumption , suppose you have a file inside your xcode project and out of xcode you edited it without hitting save , then inside xcode you tried to edit that same file , then you'll get that message
Xcode version : the one you currently editing
Disk version : the stored version on disk
git changes the local files automatically and when the change is wide xcode shows that message , so after a git pull click Use version on disk

Related

Xcode puts old data file in bundle, not the new version of it

Xcode keeps resurrecting an old version of a bundled data file despite my best efforts to replace it with an updated version of the file.
I put a data file into my iOS document-based app project, did a build, and when run then app found the file in its main bundle as expected. Then I decided to change the data file by replacing it with a newer one. I deleted the old file from the project (reference removed and file deleted). I dragged the new file into Xcode project navigator just as before. I cleaned the build. When I rebuilt, the old file was still being put into the build output folder (the Build/Products/Debug-iphonesimulator/myproduct.app package). The original version of file does not exist anywhere on the system. I'd even emptied the Trash.
Anyone know what's going on? Is there some cache Xcode keeps that's outside the build folder structure and is not cleaned?
This isn't even anything to do with simulators or test devices. The build output is just plain wrong right on the Mac. (The app fails of course: it opens the data file but it's got the wrong, old data in it.) I've tried product cleaning, deleting the file from the project and on disk, putting the master file into Xcode under a new name, even deleting ~/Library/Developer/Xcode/DerivedData/(my project)-(alpha junk).
I'm using Xcode 10.3 on macOS Mojave 10.14.6.
The answer is to change the file type in the File Inspector of Xcode. It was "Default - Data" and should be "Data". My file is a byte stream from a NSKeyedArchiver. Apparently Xcode mangles this by trying to wrap the contents in XML.

IDEWorkspaceChecks.plist file suddenly appear after updated xcode

I suddenly start having this file in my xcode project after I updated my xcode:
myProject.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
What does this file do? Should I exclude it in version control?
You can take a look on the Xcode release notes
Xcode 9.3 adds a new IDEWorkspaceChecks.plist file to a workspace's shared data, to store the state of necessary workspace checks. Committing this file to source control will prevent unnecessary rerunning of those checks for each user opening the workspace. (37293167)
It's good to commit it to your repository.

How to handle API keys with XCode 8 and multiple developers

I have two developers working off the same codebase, I'm trying to have each dev have their own API keys both outside version control. The issue I'm running into is this:
Dev 1 adds a config file called configActual.plist, has configActual.plist on the .gitignore, commits and pushes.
Dev 2 clones the project and sees that the configActual.plist is red since xcode can find the file. Dev 2 can't just add the file because now XCode won't compile since it cannot find the original file. Even if Dev 2 forces their own file in and removes the old reference, this just adds a new record to the pbxproj, putting each dev forever out of sync.
Ultimately how do I hide a file from version control while still allowing XCode to find the local version which is outside version control?
I solved this by adding a specific version of the "missing" file through finder, then XCode recognized the new file under the old reference. It turns from red to black.

XCode 8 Git pull does not load into XCode

I have a problem pulling from remote with XCode 8. Problem is when I do Git pull, it pulls all changes, and I see that new classes are added in Finder window but it does NOT load them into XCode project. I need to add them manually in XCode every time to my project. I've tried from terminal, source tree and inside XCode, every time, same thing. With prior XCodes everything is working as expected.
Are you also getting change in xcodeproj file? May be the latest commit to server missed pushing changes to xcodeproj because of which Xcode is not able to figure out new classes etc. Xcodeproj file is the way via which Xcode recognise changes to project structure.

Xcode modifies current CoreData model version at every launch

I'm using Xcode 4.6 to work on a project which uses CoreData. The data model is now at version 13 and uses lightweight migration.
My problem: At every launch Xcode seems to modify the PROJECT.xcdatamodeld/.xccurrentversion file to be set to version 1. I noticed that the modified file is automatically added to the GIT index. The changes made to this file are NOT reflected by the GUI of Xcode which tells me that my model's current version is 13. This problem started at some point during the development process (maybe at model version 7) and persists even for new model versions. The strange thing about it that even different Xcode installations on different computers show this behavior for this project. I included a screenshot of the changes made to the file.
My workaround is to reset the changes to this file at every launch of Xcode using GIT but it's very annoying. Someone got an idea how to solve this? Seems like a bug in Xcode.
Solved: The problem was an old entry in the project.pbxproj file (Open PROJECT.xcodeproj with right click -> "Show package content"). I deleted the section as shown in my screenshot and everything is running fine.
For us, what really solved the problem was:
select the data model in the Project navigator
select the configuration (Default for us)
in the Inspector -> File inspector change the data model version by clicking the small folder icon (below Location, find the red box in the screenshot below) and selection the correct .xcdatamodel file (notice no "d" at the end of the file). See the example where I've already changed from the version "1" (Notifications.xcdatamodel) to version "2" (Notifications 2.xcdatamodel visible in the screenshot).

Resources