Join Simon Allardice for an in-depth discussion in this video Changes to Xcode, part of iOS 6 App Development New Features.
The previous major release, iOS 5, was released along with Xcode 4.2, and there were a few point releases of Xcode during 2012. We had 4.3, 4.4, 4.5, as well as a few others in between. But rather than just talk about what's new specifically in Xcode 4.6, and there really isn't a lot new in 4.6, I am going to cover the changes that have happened in Xcode since the release of iOS 5. So if, for example, you had watched the iOS SDK Essential Training or Objective-C Essential Training courses, a lot of those were recorded using Xcode 4.2 and 4.3, I am going to get up to speed on what has changed in Xcode since then.
Now, Apple often go into excruciating detail on the Xcode changes between versions. We don't really need to do that. We just need to clear the decks. So, even if you have been working with 4.4, 4.5, 4.6, I'm just going to go through and cover the two or three major impacts of each version. And over all the changes that have happened, I am only going to have three things that are big enough to talk about on their own. So Xcode 4.3 arrived. This was the one that turned Xcode into a regular App Store application that just installed into your normal Applications folder on your Mac.
Before that, we needed a separate installer application for the SDK, and it installed all the tools at a different location, and really, that was the main change of Xcode 4.3, there wasn't a lot new there. Although it did mean that you had to now open other developer tools like Instruments say from within the Xcode menu because they weren't installed as totally independent applications as they have been previously. Then we got Xcode 4.4. A couple of good things here, 4.4 didn't change much visually, but it uses a new version of the LLVM compiler, version 4, behind the scenes, and that supports a couple of shortcuts of efficient ways of writing Objective-C to save us some time, first, Objective-C Literals.
We've long been able to use the at sign as a shorthand to create an NSString object, but now we can use that also to create NSArrays, NSDictionaries, NSNumbers. We don't have to use some of the more tedious init methods to create these. I am going to cover literals in their own movie in just a minute. Now also with Xcode 4.4, synthesize happens by default. You don't have to write synthesize statements for your properties anymore. This was a technically minor change, a minor improvement just to kind of get away some speed bumps in the road, but it did trip a lot of people up, particularly developers new to the Objective-C world, because it meant there was a little bit of behavior now happening automatically.
But if you didn't understand what that behavior was, it wasn't clear how your properties worked. So, this is the second thing I'll talk about on its own and talk about these synthesize statements and the current best practices with them in just a moment. But first, let's finish clearing the decks. Xcode 4.5, this was the first version of Xcode to work with iOS 6 SDK. The two main points here, LLDB is now the default debugger in Xcode to bring us in line with using LLVM as the default compiler.
And AutoLayout, a new layout option that had been available in Cocoa desktop development for a while is now supported and is actually the default in iOS. And AutoLayout will be the third thing I'll cover separately. And that brings us to Xcode 4.6, no huge changes here, some general improvements in the compiler and debugger. You can do things like inspecting the elements inside NSArrays and NSDictionaries and the debugger. Okay, if you're coming from another language, you might think, big deal.
We've had that for years, well we didn't, and now we do. Now with improvements to the compiler and debugger, if you know you have older projects that are still set to use the older style GCC and GDB, know that Xcode 4.6 is the last version to support these. So, be aware that sometime soon, change your project settings over to LLVM and LLDB, because that is where Apple have planted their flag. Now, all new projects, everything we do in this course will just use LLVM and LLDB by default.
So, I've got three things to cover here, literals, synthesize, and AutoLayout. Let's do literals first.
- Understanding the impact of changes to Xcode and Objective-C
- Adding and configuring the new UICollectionView
- Dynamically changing the size of collection view cells
- Using Auto Layout to arrange an iOS user interface
- Creating a custom pass with the Passbook API
- Posting to Facebook with the Social framework