The low-level Objective-C runtime API is significantly updated in Mac 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.
arith_t
: Changed from int
to intptr_t
.
uarith_t
: Changed from unsigned
to uintptr_t
.
The following functions are unchanged:
The following function is modified:
object_copy
(The nBytes parameter is changed from unsigned
to size_t
.)
The following functions are added:
The following functions are deprecated:
object_copyFromZone: deprecated in favor of object_copy
object_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
The following functions are unchanged:
The following function is modified:
class_createInstance: idxIvars parameter Changed from unsigned
to size_t
The following functions are added:
The following functions are deprecated:
objc_getClasses
: deprecated in favor of objc_getClassList
class_createInstanceFromZone
: deprecated in favor of class_createInstance
class_nextMethodList
: deprecated in favor of new class_copyMethodList
class_lookupMethod
: deprecated in favor of class_getMethodImplementation
class_respondsToMethod
: deprecated in favor of class_respondsToSelector
The following function is used only by ZeroLink:
objc_getRequiredClass
The following function is unchanged:
The following functions are added:
The following functions are deprecated:
objc_addClass
: deprecated in favor of objc_allocateClassPair
and objc_registerClassPair
class_addMethods
: deprecated in favor of new class_addMethod
class_removeMethods
: deprecated with no substitute
class_poseAs
: deprecated in favor of categories and method_setImplementation
The following function is unchanged:
The following functions are added:
The following functions are deprecated:
The following functions are added:
The following functions are unchanged:
The following function is added:
The following function is deprecated:
sel_isMapped
: deprecated with no substitute
The following functions are deprecated favor of dyld:
objc_loadModules
objc_loadModule
objc_unloadModules
The following functions are deprecated:
objc_setClassHandler
: deprecated with no substitute
objc_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
The following functions are unchanged:
The following functions are removed:
objc_msgSendv | Given an argument list, send a message with a simple return value. |
objc_msgSendv_stret | Given an argument list, send a message with a data-structure return value. |
objc_msgSendv_fpret | Given an argument list, send a message with a floating point return value. |
The following functions are added:
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
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
are unchanged. They are limited to 4 billion entries.
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, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-11-19)