阅读背景:

有没有办法在其属性/方法之一上引用自定义类对象?

来源:互联网 

For example I've got class:

比如我上课了:

@interface CustomClass: NSObject
    @property(nonatomic, readwrite) NSString *name;
    @property(nonatomic, readwrite) NSNumber *value;
    -(NSDictionary *)getDict;
@end

@implementation CustomClass
-(NSDictionary)getDict
{
    NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary: @{}];
    if(self.name) {
        dict[@"name"] = self.name;
    }
    if(self.value) {
        dict[@"value"] = self.value;
    }
    return dict;
}
@end
@interf



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: