gpt4 book ai didi

iphone - 无法使用 Sharekit。 "ShareKit must be configured before use"

转载 作者:行者123 更新时间:2023-11-29 13:29:04 28 4
gpt4 key购买 nike

如果我使用 DefaultSHKConfigurator 类,它会告诉我它需要在使用前进行配置。

 *** Terminating app due to uncaught exception 'IllegalStateException', reason: 'ShareKit must be configured before use. Use your subclass of DefaultSHKConfigurator, for more info see https://github.com/ShareKit/ShareKit/wiki/Configuration. Example: ShareKitDemoConfigurator in the demo app'

因此,如果我创建一个自定义 SHK 配置器而不是扩展 DefaultSHKConfigurator,它会说有一个'Duplicate Interface Definition for class 'DefaultSHKConfigurator''

在这种情况下,这是我在其中创建配置器的 applicationDiDfinishLaunching:

-(void)applicationDidFinishLaunching:(UIApplication *)application{
NSLog(@"application did finish launching.");
DefaultSHKConfigurator *configurator = [[CustomSHKConfigurator alloc] init];
[SHKConfiguration sharedInstanceWithConfigurator:configurator];
}

如果它正在使用 DefaultSHKConfigurator,我会更改代码以分配并初始化 DefaultSHKConfigurator...。但是,这两种方法都无法阻止我收到这个我并不真正理解的错误。

修复:

需要调用进来。

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{

最佳答案

修复:需要在

中调用
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

关于iphone - 无法使用 Sharekit。 "ShareKit must be configured before use",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12306775/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com