我可以在 iOS 中将选择器作为属性吗? 像这样:
@property (nonatomic, strong) SEL *mySelector;
最佳答案
当然可以,但不是strong
,因为它不是对象类型。
另外 SEL
不应该是一个指针(除非你真的是这个意思)
@property (nonatomic) SEL mySelector;
作为奖励,这里是 SEL
类型的实际定义,取自 objc.h
/// An opaque type that represents a method selector.
typedef struct objc_selector *SEL;
关于ios - 我可以将选择器作为 iOS 中的属性吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22152950/