DefaultSHKConfigurator

DefaultSHKConfigurator

如果我使用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)应用程序:(UIApplication *)应用程序didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

最佳答案

FIX:它需要被调用

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

10-05 21:57