不能使用Sharekit。 “必须在使用前配置ShareKit”

时间:2012-09-06 19:08:42

标签: iphone ios sdk sharekit

如果我使用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 ....但是这两种方法都阻止我得到这个我不太懂的错误。

FIX:

需要调用它。

  • (BOOL)应用程序:(UIApplication *)应用程序didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

1 个答案:

答案 0 :(得分:1)

FIX:需要在

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