LayerKit -> CoreAnimation


Pretty much everything in LayerKit has been moved to QuartzCore. LayerKit was really just the older name of CoreAnimation, and now most anything that was LK* maps to something similar in CA*. The names, however, aren't always the same. For example, LKCurrentTime has become CACurrentMediaTime.

UIFont/UIColor vs. CG/GS*Ref


Fonts and colors are handled by GraphicsServices and CoreGraphics, respectively. This used to be exposed directly in UIKit for 1.x (setColor: for example would normally take a CGColorRef). The new UIKit, however, has wrapped these primitives in Objective-C guises. Converting back/forth between the types is typically easy.

Using PrivateFrameworks


In order to keep application developers from using backend APIs of other applications (i.e., APIs that are going to change often and lead to unstable, brittle applications), Apple has moved most of their internal-use-only libraries into /System/Library/PrivateFrameworks, which is not normally on the link path. To add this back you need to pass this directory to gcc with -F.

Using Undocumented UIKit


The #1 thing to understand about UIKit is that Apple mostly didn't change it. For some unknown backwards compatibility reason they left in most of the 1.x classes, which means that most code for 1.x can be compiled with only minor naming differences for the new platform. (Thanks goes to Jonathan Zdziarski (NerveGas) for figuring this out.)


UIAlertSheet - UIActionSheet
UIButtonBar - UIToolbar
UINavBarButton - ???
UISliderControl - UIOldSliderControl
UISwitchControl - _UISwitchSlider
UIWebView - UIWebDocumentView

Alert/Action Sheet Dismissal


Pretty much all usages of dialog boxes involved dismissing the dialog box during a buttonClicked: event. Apple has renamed this to didDismissWithButtonIndex: and does the call to -(void)dismiss.

Double vs. Single Precision


A few places in the original UIKit libraries Apple was using double's, even though pretty much everywhere they use floats. These places have been changed. One such example is [UIProgressBar setProgress:(float)].

Automatic Keyboard Support


Apple has decided that manually having to manage the keyboards that go with text input fields is stupid, and I must say I agree with them. Unfortunately, this means that code that used to manually bring up keyboards is now dangerously out of date: you end up with two keyboards, only one of which normally works.

CoreGraphics vs. ImageIO


Most programs that need to draw things to the screen do not need to have complex data input/output from said graphics buffers. All of this file format and color munging code was probably taking up too much memory, so it got forked out to a different library: ImageIO. Examples: CGImageDestination/Source.

UIApplicationMain(Class)


Previous, UIApplicationMain() was passed the metaclass object of a type that derived from the class UIApplicationMain, which it would then instantiated. Now it optionally takes the names of two separate classes that take on different aspects of UIApplication's functionality. If you pass the name of your old class for both these arguments you will get seemingly identical behavior.

mprotect(), NX, and max_prot


While this information doesn't apply to applications developed for JailBroken devices, it is still useful to understand that Apple has started taking measures to protect against arbitrary code execution. In addition to code signing, pages that were once writable can never be marked executable, which means no JIT compilers or dynamic trampolines (in other words, bye bye performance). This particular issue has been patched out of the kernel by Pwnage.

*Mouse* vs. *Touch*


Somewhere in the 2.x timeframe, Apple realized that using the term "Mouse" made no sense and switched to "Touch". Recoding these can get difficult (and I've so far failed), but luckily we can call the (utterly undocumented, of course) UIApplicationUseLegacyEvents(YES).

Lack of Legacy Support


In general, when the iPhone is missing an interface, Apple didn't really want you to use it anyway. An example of this is that UNIX '03 and 64-bit inode support is now mandatory. This means that code that may have used to work with dirents (or some of the more crazy areas of Mach threading) tend to get messed up if compiled poorly on the new system. If you are using the complete "Upgraded" Toolchain instructions then this is likely to be taken care of, but otherwise you might have #define these features manually to make them work.

(Actually, even #defines may not help you, as Apple has also changed the symbol mangling. It's still useful to list the types of changes, though.)


_DARWIN_USE_64_BIT_INODE
__DARWIN_UNIX03