How Do I Work on Xcode Projects on Multiple Computers? - ios

I am attempting to store my Xcode project files on iCloud Drive, with hopes of accessing them on multiple computers. I am having an issue with a project when accessed from a second computer. The project builds and runs fine in the simulator, but the storyboard is missing objects and just looks completely different.
I am learning git at the moment, so I will eventually handle this properly. But as I learn Swift and programming in general, I thought this method would be easiest for now.
Any ideas what could be causing the storyboard to be different on the second computer?
Thank you.

Just spend a day or two to learn git, you will thank yourself later. Saving the files on a cloud drive will lead to many headaches.

Forget that; learn git now and start using it.
Create an account on bitbucket.org to store your repos privately, which is free for small (< 5 man) teams.

Related

What is the best way to move updated files from Mac/windows

I'm very new to coding and building my first rails website.
I use a Mac laptop to edit when I'm not home and a windows desktop. Up until now I've been using Dropbox to store the files and uploading/downloading from there when required.
The last time I tried uploading from my Mac, it didn't copy many files at all and I was wondering what the best way to do this going forward would be?
I'd use a proper version control system, such as git or mercurial. So you'd upload your code to a central repository (github, for example) from your mac and get/fetch these latest updates on windows. And vice versa.
This might seem like an overly complicated solution to this problem, but you'll have to learn version control anyway. Might as well start now.

ZF2 shared installation for many virtual hosts

I have many projects in the same Centos server and I'd rather like to install ZF2 once in a location like /usr/share/zf2 instead installing it with Skeleton all the time as duplicate libraries with projects and use ZF2_PATH in all my applications. Naturally, I'd like to use composer to update this shared zf2 library as well.
I can make it work in my way but I'd like to know if there is a conventional/preferred way to do this.
What I would do is:
1- Install ZF2 in /usr/share/zf2
2- Set ZF2_PATH environment
3- Remove Zend Framework 2 requirement from composer.json of the projects and update all as necessary.
I am just trying to follow a proven/accepted/easy-to-maintain method instead discovering it.
Thank you very much.
This is unconventional, there is no "proven/accepted" way of doing it and many people will have different opinions.
Downside of your solution is the need of testing all 3 apps when upgrading Zend Framework, I am sure you can imagine multiple scenarios when it could be handy to upgrade it just for one. If anything goes wrong, and things do go wrong, you will end-up breaking all 3 apps, not just one.
The only upside is saving space, but is that really an upside any more? Isn't disk space very cheap. Breaking your code is definitely more expensive (I am talking about cost of your time, potential loss of data or users).
If you still want to proceed you can create a 4th project with its own composer.json file and use it for any shared dependencies.

Compiling an Xcode project from a network folder

I'm trying to compile an iOS project in xcode from a network folder and I get all sorts of issues, most of them about files not being found on the first build command.
Most of the time it just says it hasn't found the headers inside other headers. If I hit Build again, the previous errors go away and new ones appear. Other times it just says "xxx.h" Resource temporarily unavailable. Hitting build again, ofcourse that is available but some other header is now unavailable, and it just makes things very frustrating.
PS: I am connected to a network folder from a Windows System using SMB. Sometimes if I disconnect, and reconnect to the network folder it briefly works flawlessly for like 3 seconds, and then starts spewing off resource unavailable errors. Unfortunately my build process lasts longer than 3 seconds :|.
UPDATE : It seems like the cause was disk access latency. I am running an OS X Virtual Machine and connecting to my real machine's HDD. I have now moved the entire VM to an SSD drive and everything works much smoother and it seems I don't have these issues anymore, so disk access times make all the difference :).
UPDATE 2 : For some reason I'm getting this error again. No idea what changed the situation.
Seems like it could be referenced files that aren't copied to project folder. I have lots of projects that are located on a server resource and as long as all the resources used by the project are included in the project it works fine.
That said, my personal choice these days is to house all of my projects in Dropbox. Still have to be careful of forgetting to copy any added files into the project folder, but it is lots easier for me to manage working on these apps on the various machines I work from.
In my experience, trying to work with an Xcode project that resides on a network share is completely hopeless. As you say, all sorts of random errors, some of the time, but not all the time. I simply have a "special" folder on the Mac that is instead shared to the OTHER machines on my network, and anytime I want to work on an Xcode project, I copy the project over into that "local" folder (and back when done). Highly inefficient and error-prone, but in my experience the only thing that works reliably (pretty sad really!)

Is there any documentation for building Xcode 4 plugins?

Recently I've noticed a couple of projects on github that extend the functionality of Xcode 4 via plugins.
Two projects as examples by #olemoritz:
MiniXcode changes the main toolbar.
ColorSense provides overlays to help pick colours.
Both projects are installed into ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins and Xcode just picks them up.
Are there any sources of documentation (officlal or user generated) on extending Xcode?
Edit: ping #olemortiz ;)
As I wrote those plugins you mentioned, here are some pointers:
There is no official documentation from Apple, so while Xcode does have a plugin infrastructure, it is entirely private API. (but hey, no one wants to submit Xcode plugins to the App Store, right? ;)) – The usual warnings apply: You should code very defensively, and it's possible that Xcode updates break things. Any plugin can bring Xcode down entirely, so be careful.
There is a seemingly abandoned effort to document the plugin interface here.
There are some open source projects that allow you to see what's needed to get a plugin loaded at all, e.g. mine and there's CLITool-Infoplist (I think that's where I got the basic structure from, but I can't really remember, because I've been doing this without publishing anything for quite a while).
You can use class-dump to generate headers from Xcode's private frameworks, e.g. IDEKit and IDEFoundation (in Xcode.app/Contents/Frameworks). Reading those gives you quite a bit of information on how Xcode is structured internally. DVTKit and DVTFoundation (in Xcode.app/Contents/SharedFrameworks) can also be useful to class-dump.
You can observe all notifications that are sent in Xcode by registering an observer for nil. I initially just logged all those notifications to get an idea of where I might be able to hook into.
Good luck!
There is no formal API or documentation.
Having said that nearly all community plugins are open sourced, use http://alcatraz.io to discover new plugins, then follow their github source code to learn how people are implementing them.
Here are some useful resources:
Use https://github.com/edwardaux/XcodeExplorer to discover the API hook point you need to be poking around.
Look at http://www.blackdogfoundry.com/blog/creating-an-xcode4-plugin/ for a series of posts about building Xcode plugins.
Check https://github.com/kattrali/Xcode-Plugin-Template for a Xcode 6+ template for creating new plugins.
Look at https://github.com/zats/AdjustFontSize-Xcode-Plugin as a good Xcode 7.1+ starting point
See http://www.blackdogfoundry.com/blog/debugging-your-xcode-plugin/ for debugging aid

Sharing an Xcode project between different teams

I'm a novice iOS developer with a basic knowledge of Xcode. I have one app in the app store that I made myself with Titanium. For a next project I've enlisted the help of two more experienced programmers in another city. I have a question in two parts about the collaboration between us:
I want to propose a work routine that gives me access to the project as they are working on it, so that I can device test builds during the development process - without interfering with the coding. What is the best way to do this? Is sharing the project or codebase via Dropbox an option? Does anybody have any experience with this?
Are there any pitfalls I should be aware of when pursuing this kind of work routine?
Thanks!
Use a source control system like Subversion, Git, Mercurial.
XCode has built in support for Subversion/Git.
Use source control. Github is a great place to start. (private repositories will cost money though.)
I used to use DropBox to share code between my two machines, but DropBox would routinely ruin work if I wasnt careful. DropBox is NOT version control. If you do insist in using Dropbox, don't open your code on more than one machine at once. Nuff said.

Resources