###[self class]
有没有觉得这样写比较奇怪。如果想在实例方法中访问静态方法,还必须这样写才好!
- (Class)class OBJC_SWIFT_UNAVAILABLE("use 'anObject.dynamicType' instead");
###具体运用
- (void)publishBonjour {
if(...){
}
[[self class] startBonjourThreadIfNeeded];//因为是静态方法,如果获取?就用[self class]
}
+ startBonjourThreadIfNeeded {
if(...)
}