iOS 之動態運行時 runtime <二>

來源:互聯網
上載者:User

標籤:

/* Working with Classes *//**  * Returns the name of a class. *  * @param cls A class object. *  * @return The name of the class, or the empty string if \e cls is \c Nil. */OBJC_EXPORT const char *class_getName(Class cls)      __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);/**  * Returns a Boolean value that indicates whether a class object is a metaclass. *  * @param cls A class object. *  * @return \c YES if \e cls is a metaclass, \c NO if \e cls is a non-meta class,  *  \c NO if \e cls is \c Nil. */OBJC_EXPORT BOOL class_isMetaClass(Class cls)      __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);/**  * Returns the superclass of a class. *  * @param cls A class object. *  * @return The superclass of the class, or \c Nil if *  \e cls is a root class, or \c Nil if \e cls is \c Nil. * * @note You should usually use \c NSObject‘s \c superclass method instead of this function. */OBJC_EXPORT Class class_getSuperclass(Class cls)      __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);/**  * Sets the superclass of a given class. *  * @param cls The class whose superclass you want to set. * @param newSuper The new superclass for cls. *  * @return The old superclass for cls. *  * @warning You should not use this function. */OBJC_EXPORT Class class_setSuperclass(Class cls, Class newSuper)      __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_5, __IPHONE_2_0,__IPHONE_2_0);/**  * Returns the version number of a class definition. *  * @param cls A pointer to a \c Class data structure. Pass *  the class definition for which you wish to obtain the version. *  * @return An integer indicating the version number of the class definition. * * @see class_setVersion */OBJC_EXPORT int class_getVersion(Class cls)    __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/**  * Sets the version number of a class definition. *  * @param cls A pointer to an Class data structure.  *  Pass the class definition for which you wish to set the version. * @param version An integer. Pass the new version number of the class definition. * * @note You can use the version number of the class definition to provide versioning of the *  interface that your class represents to other classes. This is especially useful for object *  serialization (that is, archiving of the object in a flattened form), where it is important to *  recognize changes to the layout of the instance variables in different class-definition versions. * @note Classes derived from the Foundation framework \c NSObject class can set the class-definition *  version number using the \c setVersion: class method, which is implemented using the \c class_setVersion function. */OBJC_EXPORT void class_setVersion(Class cls, int version)    __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/**  * Returns the size of instances of a class. *  * @param cls A class object. *  * @return The size in bytes of instances of the class \e cls, or \c 0 if \e cls is \c Nil. */OBJC_EXPORT size_t class_getInstanceSize(Class cls)      __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);

 

iOS 之動態運行時 runtime <二>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.