zoukankan      html  css  js  c++  java
  • NSObject

    Objective-C是动态语言,每个类class都会在运行时创建一个类对象。

    NSObject是根类,当然是最重要的一个类,提供的一些公共方法,顾名思议。

    @protocol NSObject
    // 是否引用同一对象
    - (BOOL)isEqual:(id)object;
    - (NSUInteger)hash;
    
    - (Class)superclass; - (Class)class; - (id)self; - (NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
    - (id)performSelector:(SEL)aSelector; - (id)performSelector:(SEL)aSelector withObject:(id)object; - (id)performSelector:(SEL)aSelector withObject:(id)object1 withObject:(id)object2; - (BOOL)isProxy; - (BOOL)isKindOfClass:(Class)aClass; - (BOOL)isMemberOfClass:(Class)aClass; - (BOOL)conformsToProtocol:(Protocol *)aProtocol; - (BOOL)respondsToSelector:(SEL)aSelector; - (id)retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE; - (oneway void)release NS_AUTOMATED_REFCOUNT_UNAVAILABLE; - (id)autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE; - (NSUInteger)retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE; - (NSString *)description; @optional - (NSString *)debugDescription; @end // 浅copy @protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end // 深copy @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end // 序列化 @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; - (id)initWithCoder:(NSCoder *)aDecoder; @end // Objects which are safe to be encoded and decoded across privilege boundaries should adopt NSSecureCoding instead of NSCoding. Secure coders (those that respond YES to requiresSecureCoding) will only encode objects that adopt the NSSecureCoding protocol. @protocol NSSecureCoding <NSCoding> @required // This method must be return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. // The Secure Coding Guide should be consulted when writing methods that decode data. + (BOOL)supportsSecureCoding; @end /*********** Base class ***********/ NS_ROOT_CLASS @interface NSObject <NSObject> { Class isa; } + (void)load; + (void)initialize; - (id)init; + (id)new; + (id)allocWithZone:(NSZone *)zone; + (id)alloc; - (void)dealloc; - (void)finalize; - (id)copy; - (id)mutableCopy; + (id)copyWithZone:(NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE; + (id)mutableCopyWithZone:(NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE; + (Class)superclass; + (Class)class; + (BOOL)instancesRespondToSelector:(SEL)aSelector; + (BOOL)conformsToProtocol:(Protocol *)protocol; - (IMP)methodForSelector:(SEL)aSelector; + (IMP)instanceMethodForSelector:(SEL)aSelector; - (void)doesNotRecognizeSelector:(SEL)aSelector; - (id)forwardingTargetForSelector:(SEL)aSelector NS_AVAILABLE(10_5, 2_0); - (void)forwardInvocation:(NSInvocation *)anInvocation; - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector; + (NSMethodSignature *)instanceMethodSignatureForSelector:(SEL)aSelector; - (BOOL)allowsWeakReference NS_UNAVAILABLE; - (BOOL)retainWeakReference NS_UNAVAILABLE; + (NSString *)description; + (BOOL)isSubclassOfClass:(Class)aClass; + (BOOL)resolveClassMethod:(SEL)sel NS_AVAILABLE(10_5, 2_0); + (BOOL)resolveInstanceMethod:(SEL)sel NS_AVAILABLE(10_5, 2_0); @end @interface NSObject (NSCoderMethods) + (NSInteger)version; + (void)setVersion:(NSInteger)aVersion; - (Class)classForCoder; - (id)replacementObjectForCoder:(NSCoder *)aCoder; - (id)awakeAfterUsingCoder:(NSCoder *)aDecoder NS_REPLACES_RECEIVER; @end
  • 相关阅读:
    ACTION 的跳转与参数传递
    action 与 action 之间的跳转
    图片不存在时,显示一个默认的图片 (自己理解)
    java 防止表单重复提交(serlvet)
    java防止表单重复提交
    了解 Windows Azure 存储计费 – 带宽、事务和容量
    微软开放技术热烈祝贺开源社成立!
    “开源社”(开源联盟)成立
    Azure SQL 数据库的灵活缩放预览版简介
    通过 PowerShell 支持 Azure Traffic Manager 外部端点和权重轮询机制
  • 原文地址:https://www.cnblogs.com/iprogrammer/p/3252332.html
Copyright © 2011-2022 走看看