Files
MinFt/Client/LocalPackages/com.thinkingdata.analytics@6408c68cf9/Plugins/iOS/ThinkingSDK/Source/Router/TAContext.m
Liubing\LB 3d8d4d18f3 first commit
先修复一下,错误的场景

删除不必要的钓场资产

修复into场景

update:更新meta文件,修复报错

update:修复资源

修复第一章节建造

修复建造第三章

update:删除多余内容

update:更新README.md

update:还原图标

update:更新README

update:更新配置
2026-04-28 02:17:22 +08:00

69 lines
1.5 KiB
Objective-C

//
// TAContext.m
// ThinkingSDK.default-Base-Core-Extension-Router-Util-iOS
//
// Created by wwango on 2022/10/7.
//
#import "TAContext.h"
@interface TAContext()
@property(nonatomic, strong) NSMutableDictionary *modulesByName;
@property(nonatomic, strong) NSMutableDictionary *servicesByName;
@end
@implementation TAContext
+ (instancetype)shareInstance
{
static dispatch_once_t p;
static id instance = nil;
dispatch_once(&p, ^{
instance = [[[self class] alloc] init];
});
return instance;
}
- (void)addServiceWithImplInstance:(id)implInstance serviceName:(NSString *)serviceName
{
[[TAContext shareInstance].servicesByName setObject:implInstance forKey:serviceName];
}
- (void)removeServiceWithServiceName:(NSString *)serviceName
{
[[TAContext shareInstance].servicesByName removeObjectForKey:serviceName];
}
- (id)getServiceInstanceFromServiceName:(NSString *)serviceName
{
return [[TAContext shareInstance].servicesByName objectForKey:serviceName];
}
- (instancetype)init
{
self = [super init];
if (self) {
self.modulesByName = [[NSMutableDictionary alloc] initWithCapacity:1];
self.servicesByName = [[NSMutableDictionary alloc] initWithCapacity:1];
}
return self;
}
- (instancetype)copyWithZone:(NSZone *)zone {
TAContext *context = [[self.class allocWithZone:zone] init];
context.application = self.application;
context.launchOptions = self.launchOptions;
return context;
}
@end