zoukankan      html  css  js  c++  java
  • iOS 反射获取类的属性列表

    // 获取对象所有属性:
    
    - (NSArray*)propertyKeys
    
    {
    
        unsigned int outCount, i;
    
        objc_property_t *properties = class_copyPropertyList([self class], &outCount);
    
        NSMutableArray *keys = [[NSMutableArray alloc] initWithCapacity:outCount];
    
        for (i = 0; i < outCount; i++) {
    
            objc_property_t property = properties[i];
    
            NSString *propertyName = [[NSString alloc] initWithCString:property_getName(property) encoding:NSUTF8StringEncoding];
    
            [keys addObject:propertyName];
    
        }
    
        free(properties);
    
        return keys;
    
    }
  • 相关阅读:
    GARP和GVRP
    VLAN间路由
    Voice VLAN
    VLAN
    SSH
    Telnet
    FTP
    DHCP
    STP
    交换机
  • 原文地址:https://www.cnblogs.com/yaoxc/p/4171041.html
Copyright © 2011-2022 走看看