Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2020 Developer Tools

WWDC20 · 23 min · Developer Tools

Advancements in the Objective-C runtime

Dive into the microscopic world of low-level bits and bytes that underlie every Objective-C and Swift class. Find out how recent changes to internal data structures, method lists, and tagged pointers provide better performance and lower memory usage. We’ll demonstrate how to recognize and fix crashes in code that depend on internal details, and show you how to keep your code unaffected by changes to the runtime.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 4 snippets

Use the heap command to calculate memory savings bash · at 5:37 ↗
heap Mail | egrep 'class_rw|COUNT'
Use the APIs objectivec · at 7:35 ↗
class_getName

class_getSuperclass

class_copyMethodList
Use the APIs objectivec · at 14:38 ↗
method_getName

method_getTypeEncoding

method_getImplementation
Use the APIs objectivec · at 21:52 ↗
if ([obj isKindOfClass:[NSString class]]) {
    // a string
}
NSUInteger length = [obj length];


if (CFGetTypeID(obj) == CFStringGetTypeID()) {
    // a string
}
CFIndex length = CFStringGetLength(obj);

Resources