search

Home  >  Q&A  >  body text

ios - 为什么WXInvocationConfig这个抽象类会使用单例模式?

为什么WXInvocationConfig这个抽象类会使用单例模式?

+ (instancetype)sharedInstance
{
    static id _sharedInstance;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedInstance = [[self alloc] init];
    });
    
    return _sharedInstance;
}
黄舟黄舟2771 days ago623

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 09:57:15

    A singleton was used in this place before, but now it is not used. I will consider getting rid of it. Thanks for the tip

    reply
    0
  • Cancelreply