OS X Version 10.5 Delta
The low-level Objective-C runtime API is significantly updated in OS X version 10.5. Many functions and all existing data structures are replaced with new functions. This document describes the differences between the 10.5 version and previous versions.
Runtime Functions
Basic types
arith_t: Changed from int to intptr_t.
uarith_t: Changed from unsigned to uintptr_t.
Instances
The following functions are unchanged:
The following function is modified:
object_copy(The nBytes parameter is changed fromunsignedtosize_t.)
The following functions are added:
The following functions are deprecated:
object_copyFromZone: deprecated in favor of
object_copyobject_realloc
object_reallocFromZone: no substitute
_alloc: no substitute
_copy: no substitute
_realloc: no substitute
_dealloc: no substitute
_zoneAlloc: no substitute
_zoneRealloc: no substitute
_zoneCopy: no substitute
_error: no substitute
Class Inspection
The following functions are unchanged:
The following function is modified:
class_createInstance: idxIvars parameter Changed from
unsignedtosize_t
The following functions are added:
The following functions are deprecated:
objc_getClasses: deprecated in favor ofobjc_getClassListclass_createInstanceFromZone: deprecated in favor ofclass_createInstanceclass_nextMethodList: deprecated in favor of newclass_copyMethodListclass_lookupMethod: deprecated in favor ofclass_getMethodImplementationclass_respondsToMethod: deprecated in favor ofclass_respondsToSelector
The following function is used only by ZeroLink:
objc_getRequiredClass
Class Manipulation
The following function is unchanged:
The following functions are added:
The following functions are deprecated:
objc_addClass: deprecated in favor ofobjc_allocateClassPairandobjc_registerClassPairclass_addMethods: deprecated in favor of newclass_addMethodclass_removeMethods: deprecated with no substituteclass_poseAs: deprecated in favor of categories andmethod_setImplementation
Methods
The following function is unchanged:
The following functions are added:
The following functions are deprecated:
method_getArgumentInfomethod_getSizeOfArguments
Instance Variables
The following functions are added:
Selectors
The following functions are unchanged:
The following function is added:
The following function is deprecated:
sel_isMapped: deprecated with no substitute
Runtime
The following functions are deprecated favor of dyld:
objc_loadModulesobjc_loadModuleobjc_unloadModules
The following functions are deprecated:
objc_setClassHandler: deprecated with no substituteobjc_setMultithreaded: deprecated with no substitute
The following previously undocumented functions are deprecated with no substitute:
objc_getOrigClass
_objc_create_zone
_objc_error
_objc_flush_caches
_objc_resolve_categories_for_class
_objc_setClassLoader
_objc_setNilReceiver
_objc_getNilReceiver
_objcInit
The following undocumented functions are unchanged:
_objc_getFreedObjectClass
instrumentObjcMessageSends
_objc_debug_class_hash
_class_printDuplicateCacheEntries
_class_printMethodCaches
_class_printMethodCacheStatistics
Messaging
The following functions are unchanged:
The following functions are removed:
objc_msgSendv | |
objc_msgSendv_stret | |
objc_msgSendv_fpret |
Protocols
The following functions are added:
Exceptions
The following functions are unchanged:
objc_exception_throw
objc_exception_try_enter
objc_exception_try_exit
objc_exception_extract
objc_exception_match
objc_exception_get_functions
objc_exception_set_functions
Synchronization
The following functions are unchanged:
objc_sync_enter
objc_sync_exit
objc_sync_wait
objc_sync_notify
objc_sync_notifyAll
These functions are only used by the compiler.
NXHashTable and NXMapTable
NXHashTable and NXMapTable are unchanged. They are limited to 4 billion entries.
Structures
The objc_super struct is unchanged:
struct objc_super { |
id receiver; |
Class super_class; |
}; |
All other structures deprecated in favor of opaque types and functional API. Substitutes are shown in the following tables.
Variable |
Substitution |
|---|---|
|
object_getClass(), object_setClass() |
struct objc_class *super_class; |
class_getSuperclass() |
const char *name; |
class_getName() |
long version; |
class_getVersion(), class_setVersion() |
long info; |
class_isMetaClass() |
long instance_size; |
no substitute |
struct objc_ivar_list *ivars; |
class_copyIvarList(), class_addIvar() |
struct objc_method_list **methodLists; |
class_copyMethodList(), class_addMethod() |
struct objc_cache *cache; |
no substitute |
struct objc_protocol_list *protocols; |
class_copyProtocolList(), class_addProtocol() |
Variable |
Substitution |
|---|---|
SEL method_name; |
method_getName() |
char *method_types; |
method_getTypeEncoding() |
IMP method_imp; |
method_getImplementation(), method_setImplementation() |
Variable |
Substitution |
|---|---|
char *ivar_name; |
ivar_getName() |
char *ivar_type; |
ivar_getTypeEncoding() |
int ivar_offset; |
ivar_getOffset() |
There are no substitutes for the following structs:
objc_object {...};
objc_category {...};
objc_method_list {...};
objc_ivar_list {...};
objc_protocol_list {...};
objc_cache {...};
objc_module {...};
objc_symtab {...};
© 2002, 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-06-17)