if (对象) {
SEL sel = NSSelectorFromString(属性名);
if ([对象 respondsToSelector:sel]) {
IMP imp = [对象 methodForSelector:sel];
NSString (func)(id, SEL) = (void *)imp;
NSString *f = func(对象, sel);
return f;
}
}
if (对象) {
SEL sel = NSSelectorFromString(属性名);
if ([对象 respondsToSelector:sel]) {
IMP imp = [对象 methodForSelector:sel];
NSString (func)(id, SEL) = (void *)imp;
NSString *f = func(对象, sel);
return f;
}
}
本文标题:vicki753's iOS 基础-- 对象的属性方法怎么写
本文链接:https://www.haomeiwen.com/subject/vorezhtx.html
网友评论