Whenever you have a couple of apps that are extremely similar, it will make sense to share the code between the two. For example, a Lite version and a Paid version of the same app, or the same app skinned differently for different clients. At first you might be tempted in duplicating the project. Don’t. If the code splits then it’s going to be a nightmare copying changes between two places, or even just having them in two separate projects.
When coding, personal notes are a good way to make sure you don’t forget anything, and keep track of certain things. I often see people making notes either physically or in a document, however there is a better solution…
Automatic Reference Counting (ARC) has been around since iOS 5, however it has been an optional tick box when beginning a new project, and if not selected, Manual Reference Counting (MRC) is used. As of Xcode 5, the ARC tick box is missing, and all new projects start with ARC. While you can still disable ARC manually in the project's config file, this is probably a good sign that ARC is the way to go for new projects.
When you send a build to your client or testers, it can be difficult telling development builds from AppStore builds. At b2cloud we split the builds with two different app ids, and a different app title to make it easy to tell them apart. Because the app id is different it means you can have both builds on your device at the same time, and the development one wont overwrite the AppStore one, and vice versa.
Unit Tests are a good way to ensure things don’t break while coding. In Xcode by default they are run manually. Because it’s manual you may forget to run them, or a new person to the project may not know about them. You can set Xcode up to run them automatically every time you build your app, which ensures nothing will go unnoticed.
Here’s how to do that.
If you started an Xcode project a long time ago or just didn’t tick the “Include Unit Tests” box when creating your project, it may be a bit confusing how to get them in. Not to fear, I will show you how.
A while back a couple of our devs were having some problems syncing to the git. It seemed everything but their Xcode projects would sync up. I looked into it, and while it took a bit to solve the problem I finally figured out what the issue was.
The solution was quite buried, so hopefully this post helps at least one other person out there.
There have been a few very rare scenarios where I have actually required a dynamic header in a project. I mention Xcode in the title however this technique really applies to nearly any IDE or command line project.
When developing an iOS or Mac app, NSLogs are very handy during development. These are quite useless for an app on an end users phone or computer, so removing every log is often a good idea, especially if you like to log a lot of information. This might sound like a pain, commenting out every NSLog whenever you build for the AppStore? But no, there’s a much simpler solution, coming from our friend the preprocessor macro.
If you're a developer and you find your HD space just seems to disappear without your putting any new files on your computer, take a look into what Xcode is doing. For every project you create Xcode will cache a lot of data for intellisense, autocompletion, and some other features. Whether it's a test project or a full on client project, Xcode will keep this data until you delete it. On my laptop I don't think I've deleted any of this data for about 8 months, which worked out to be roughly 16GB worth. This includes archived apps I send to clients for testing purposes, stuff that I consider to be a one off.