How to handle API keys with XCode 8 and multiple developers - ios

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.

Related

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

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

After changing file locations, project can't recognize some of my classes

First off, I know this is a config issue because my code was building and running just fine before I synced my project to GitHub. Xcode's internal source control seems to be having trouble recognizing some of my files and I'm getting Use of unresolved identifier... errors where these files' initializers are in use, and were working before. I'm running the latest versions of Xcode and OS X, and these are the steps I was taking before and after the issue started...
BEFORE:
After several rounds of implementation and committing with the default local repository, I built and ran the app multiple times with no issues.
I created a new repository on GitHub, committed (w/push to remotes) and everything made it to GitHub just fine and was building and running in the simulator.
In order to organize the repository (to match the 'groups' I had created in Xcode) I did some brief research and then added nested directories to my project folder. I re-opened Xcode and repaired the file paths. Some took, but several kept showing ? (although I could still access the code just fine) and I got the corresponding Missing Files... warnings.
Because I couldn't get the new hierarchy to work (the files w/?s, not being recognized, were not able to be committed to GitHub), I tried to move the files back. This worked for most, but for a few (which seem to be the effected files) I had to rename them, recreate a new file and then paste their contents over (this is where I think the problem lies). I was able to commit everything to GitHub (even the problem files went up) but all the warnings remained.
To clear out the warnings I attempted to run my tests, and that's when the Use of unresolved identifier... errors popped up, and of course the build failed.
AFTER:
I verified all the paths and target memberships were correct.
When that didn't work, I built an entirely new project (although I did add it to the same workspace; not sure if that matters) and copy/pasted all my code over to new files. I didn't drag / reference the files and I didn't link the new project to GitHub. When I went to build, same errors in the same places...
I exited the workspace and opened the new project separately. Still no joy.
Any help or points in the right direction would be much appreciated.
EDIT:
After some help, I tried deleting the reference and dragging the file in manually but that didn't resolve the issue.
I also checked Build Phases -> Compile Sources and everything was listed fine with no compiler flags. I removed and re-added from Compile Sources, issue persists.
You can try removing referencer for the missing class file in Xcode,then add same file to folder (right click add file ) from physical workspace location this might help.
After rebuilding an entirely new app a third time, with all new files, I copied the files over and this time everything seems to be working fine. Had to repair a bunch of provisioning issues to make sure it worked (maybe that was part of the problem, but I doubt it), but everything is back to normal with the app. The only thing I did differently this time was not adding the new project to the same workspace.

How to uninstall iOS QuickBlox SDK from OS X project?

I was curious about whether the QuickBlox iOS SDK would work in a Mac OS X project. I followed these instructions:
http://quickblox.com/developers/IOS-how-to-connect-Quickblox-framework
More specifically, since my project is in Swift, I followed the ones at the bottom, the "Additional steps for Swift using Manual Installation", except that MobileCoreServices didn't exist for OS X.
When that didn't work, I messed around with the steps further up in "Manual installation" such as changing the linker flags.
It didn't work (at least not without warnings). So I undid everything I messed with (and I'm pretty sure I only messed with things that were in the instructions).
Now, when I hit run, the project says "Build Succeeded" and the bar at the top says "Finished running", but no application opens.
I checked each of the frameworks I added and they're all gone. I checked each of the "Build Settings" I changed and they're all back to how they were. In Source Control when I hit "Commit" I can see that there aren't any changes to commit. My project seems to be exactly how it used to be, and I'm left scratching my head about what could have changed. Any suggestions?
OK, I'm not sure what caused this, but here's how I got my app to run again:
First, I tried adding Quickblox to a new dummy project to try to recreate the error, but the dummy project wouldn't break in the same way that my good project did.
So then I tried to use Source Control to restore my last working version by clicking "Discard All Changes...". Source Control did not restore my last working version but instead reinstalled Quickblox, moved random files into the trash, and broke the links on all of the other files so that my list of files was mostly red.
So I decided to create a new Xcode project and move the files from my old project into this new project. While this new project was still blank, I could test "run" and see that the blank application would open onto my computer. So then I began the process of moving things over which took some time.
A couple of things to note when you're doing such a migration: entitlements and info.plist files, when dragged into a project, are added to "Copy Bundle Resources" and need to be deleted from that list. Moving an xcdatamodeld file from Finder into a project doesn't work very well, but moving it straight from another project into a project does. I had to reconfigure provisioning profiles. Then, Core Data entities can cause errors if their "Module" is still set to the old project's name (changing these modules to "Current Product Module" worked). After all of that, my project was up and running again!

Xcode project renamed and now it is lost

I was trying to rename my Xcode project and I followed the apple developer guide and went to View -> Utilities -> Open file inspector and changed the name. Now the initial project only has the pods and the new project created won't run. Is there a way to restore it? I have been working on this project for months and would be devastated if it was lost.
would be devastated if it was lost
That's what version control is for (git).
But if you don't have a git commit to revert to, don't worry; there is a simple solution. Start a new empty project based on one of the built-in app templates and just migrate everything from your old project into that. No actual files have been deleted by whatever you did, so there should be no difficulty about this.

Moving projects in Xcode 6

Currently, my Xcode Projects are in ~/Desktop/Xcode Projects/
I'd like to move all projects to ~/Desktop/Xcode Projects/Training/
One of these directories contains Classes I've defined.
Can I move Xcode 6 projects from Finder/Terminal or from within Xcode?
I'm using defaults under Xcode 6.1 (Git repository, and "Relative to Group" files.
My StackOverflow searches show steps for Xcode 4. Is this cleaner in Xcode 6??
Any solution or pointer to docs would be appreciated!
Moving the projects from one location to other should not cause any issue.
Regarding the group files that you have linked in the project file you can just that file in the Mac and re-link the same. Mostly it should be just changing the versions number of Xcode.
Nor sure about your Git config though.
I want to warn about a few possible complications, though.
First, if you've set a Custom Working Directory (e.g. via the Scheme) that pointed to a folder that you're dragging, it won't automatically update to the new location.
Second, if you've linked to custom libraries or frameworks and the path was saved relative to your project folder (which is the default behavior in XCode) then the path to these may be broken.
Oh, and the local git stuff should be fine, since git uses relative paths.

Resources