xcode iconIn support of today's extensive list of software releases, Apple has also pushed out the final public version of Xcode 4.2, now available through Apple's developer channel and on the Mac App Store. Xcode is Apple's package of developer tools for creating both OS X and iOS applications.

What's New in Version 4.2
- Includes SDKs for Mac OS X 10.7 Lion and iOS 5
- Storyboards let you design multiple iOS screens, and define the segues among them
- Automatic Reference Counting (ARC) saves you from manually managing retain/release
- iCloud entitlements are automatically enabled for Mac and iOS apps
- OpenGL ES Debugger graphically analyzes your OpenGL scene directly within the IDE
- Apple LLVM compiler supports C++11 features and the LLVM libc++ standard library
- Older iOS Simulators and device debugging symbols are downloaded on-demand

Xcode 4.2 requires OS X Lion and is a free download on the Mac App Store.

Top Rated Comments

HiRez Avatar
124 months ago
Is this similar to Garbage Collection?

It's better than garbage collection. GC is run-time technology and can have a dramatic negative effect on performance. Furthermore, the performance cannot be relied upon to be constant (CPU usage can spike when the GC is sweeping), and since you don't know beforehand when the GC is doing its business, bugs can be harder to track down (objects may disappear at unknowable times).

ARC is a compile-time technology. It inserts retain, release, and autorelease messages just as you would, then optimizes out redundancies before the binary is built. It simply uses the same well-defined memory management rules that you would except it doesn't make mistakes as a human can. There is no run-time penalty.

The biggest disadvantage for ARC is it can't detect cyclical references like a GC can, and that's why it includes the __weak type identifier. So you need to be a little careful for those situations, but overall it's a better technology than GC, which is why GC in Xcode will be going away in favor of ARC, at some point.
Score: 2 Votes (Like | Disagree)
DESNOS Avatar
124 months ago
ARC here I come! Good riddance manual memory management (for the most part)!
Score: 2 Votes (Like | Disagree)
gnasher729 Avatar
124 months ago
+1. I <3 ARC, but weak references are critical and the existence of incompatible code is irritating. Hopefully we'll get an SDK which is fully-compatible with ARC in Apple's next OS release, at which point we could make a clean break.
Actually, there are two kinds of weak references: "Safe" weak references that change to nil when the referenced object goes away, and "Unsafe" weak references that don't change to nil automatically. Both are "weak" technically weak references. Both work as "weak" references in 10.6, but the automatic change to nil doesn't happen in 10.6. So you can't rely on that if your code should run on 10.6.


Is this similar to Garbage Collection?

It's not a delta update. A hefty installer instead... (1.68 GB if you have 4.1)
No. It is the same old retain/release/autorelease thing, except that you don't write the statements anymore, but the compiler does it for you. The effects are: 1. Your code will be correct, because the compiler doesn't forget to retain or release an item when it should. 2. Your code may become faster, because the compiler optimizes unneeded retain/release away, implements autorelease pools faster, and uses specialized code instead of Objective-C methods. 3. If you have code that is so convoluted that the compiler can't figure out when to retain/release objects then it doesn't compile and you'll have to fix it. Most likely your code was broken anyway in that case.

Compared to Garbage Collection, your memory footprint will be lower.
Score: 1 Votes (Like | Disagree)
PR. Avatar
124 months ago
just tried. seems the answer is no.

Damn, thanks for checking

*rages* :mad:
Score: 1 Votes (Like | Disagree)
kainjow Avatar
124 months ago
Should I continue to download from the Dev Center or grab the App Store version?

I'm not sure if the Lion version is available on on the dev center. I downloaded it from the App Store and it went along fine. My coworker is downloading the SL one from the dev center and it's taking forever.
Score: 1 Votes (Like | Disagree)
ethana Avatar
124 months ago
Yes, ARC with Xcode 4.2 is HUGE for developers. If you are an iOS developer, look into ARC! It will save you from so many headaches from now on.

Yes, iOS 5.0 or greater is required for your binaries to use it.
Score: 1 Votes (Like | Disagree)

Top Stories

april 2021 event coverage feature

Apple Event Live Coverage: New iPads, AirTags, and More Expected [Event Over]

Tuesday April 20, 2021 9:07 am PDT by
Apple's virtual "Spring Loaded" event kicks off today at 10:00 a.m. Pacific Time, with Apple expected to debut updated iPad models and perhaps some other hardware such as AirTags or iMac models based on Apple silicon. Apple is providing a live video stream on its website, on YouTube, and in the company's TV app across its platforms. We will also be updating this article with live blog...
m1 imac colors

Apple Announces Redesigned iMac With M1 Chip and Seven Color Options

Tuesday April 20, 2021 10:22 am PDT by
Apple has announced a new, redesigned 24-inch iMac, featuring an M1 chip, a 4.5K display, and a range of color options, as well as an improved cooling system, front-facing camera, speaker system, microphones, power connector, and peripherals. The new iMac features a completely new compact design, and comes in a range of seven striking colors, including green, yellow, orange, pink, purple,...
iphone 12 preorder purple

Apple Launching iPhone 12 and 12 Mini in New Purple Color on April 30

Tuesday April 20, 2021 10:08 am PDT by
Apple today announced that the iPhone 12 and iPhone 12 mini will be available in a new purple color starting April 30, with pre-orders starting this Friday. Apple is also releasing a new MagSafe Leather Case and Leather Sleeve in Deep Violet, a Silicone Case in Capri Blue, Pistachio, Cantaloupe, or Amethyst, and a Leather Wallet in Arizona, all available to order beginning today. iPhone...
14

Apple Says iOS 14.5 Will Be Released 'Next Week'

Tuesday April 20, 2021 11:08 am PDT by
Apple today in a press release about its new AirTag item tracker announced that iOS 14.5 and iPadOS 14.5 will be available starting "next week." iOS 14.5 and iPadOS 14.5 are packed with new features, including the ability for iPhone users who are wearing an Apple Watch to unlock the iPhone with Face ID while wearing a mask. iOS 14.5 and iPadOS 14.5 will also be the minimum software versions...
ipad pro with m1 chip

Apple Introduces Next-Generation iPad Pro With M1 Chip, Thunderbolt, 5G, XDR Display, and More

Tuesday April 20, 2021 10:40 am PDT by
Apple today announced the next-generation iPad Pro with the same M1 chip found in the latest Macs, Thunderbolt and USB4 support, 5G connectivity on cellular models with mmWave support in the United States, and more. With an 8-core CPU and 8-core GPU, Apple says the M1 chip in the new iPad Pro provides up to 50% faster performance and up to 40% faster graphics compared to the A12Z Bionic chip ...
f1618938547

Apple Announces AirTag Tracking Devices Starting At $29 Each

Tuesday April 20, 2021 10:10 am PDT by
Apple today announced AirTag, a Tile-like Bluetooth tracking device that's designed to be attached to items like keys and wallets for tracking purposes, letting you find them right in the Find My app. AirTags are accessories for attaching to backpacks, luggage, and other items. Any U1 device like the iPhone 12 can be used for precision finding to guide you right to the item you're looking...
Ports 2021 MacBook Pro Mockup Feature 1 copy

Stolen MacBook Pro Schematics Confirm Apple's Plans to Add More Ports and Remove Touch Bar

Wednesday April 21, 2021 10:31 am PDT by
Schematics stolen from Apple supplier Quanta Computer outline Apple's plans for the next-generation MacBook Pro models that are expected in 2021, and clearly confirm plans for additional ports and a return to MagSafe. MacRumors saw the schematics after they were leaked online, and some of them feature the logic board of the next-generation MacBook Pro. On the right side of the machine,...
iPad Pro

New 12.9-Inch iPad Pro Will Be 0.5mm Thicker to Accommodate Mini-LED Display

Monday April 19, 2021 11:30 am PDT by
The upcoming 12.9-inch iPad Pro will be thicker than the previous-generation version, likely due to the inclusion of the mini-LED display. We've heard several rumors about the change in thickness, and now leaked design images have confirmed it. A source that designs accessories for Apple devices sent MacRumors a series of photos that feature exact dimensions for the new iPad Pro models, and...
iPad Pro Feature Orange

Wedbush Analysts Say 'Spring Loaded' Event Will Debut New iPads With 'Modest Price Increase,' Along With 'a Few Surprises'

Monday April 19, 2021 6:37 am PDT by
Apple is planning to launch a new entry-level iPad, iPad mini, and iPad Pro at its "Spring Loaded" event tomorrow, along with "a few surprises," according to Wedbush analysts. In a new note to investors, seen by MacRumors, Wedbush analysts Daniel Ives and Strecker Backe explained that the iPad will be the main focus of Apple's "Spring Loaded" event, with new entry-level iPad, iPad mini, and ...
maxresdefault

Apple Event 2021: Everything Apple Announced at Its 'Spring Loaded' Event in Just 6 Minutes

Tuesday April 20, 2021 4:23 pm PDT by
Apple today held its first event of 2021, and it was one of the most exciting events that we've seen in some time. Apple announced a whole slew of new products, including an M1 iMac, an M1 iPad Pro, a refreshed 4K Apple TV, and the long-awaited AirTags. Subscribe to the MacRumors YouTube channel for more videos. It took Apple an hour to introduce all of the new devices during its virtual...