интегрировать openfeint в макет cocos2d ipad - PullRequest
0 голосов
/ 05 октября 2011

Я успешно интегрировал openfeint в свое приложение на iPhone / iPod Touch.Но макет сломан на iPad.Я скопировал и вставил код из примера приложения из openfeint.

- (void) performOpenfeintInitLogic
{
    UIViewController * rootVC = [UIApplication sharedApplication].keyWindow.rootViewController;
    NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
                              [NSNumber numberWithInt:UIInterfaceOrientationPortrait], OpenFeintSettingDashboardOrientation,
                              @"asdasdasdas", OpenFeintSettingShortDisplayName,
                              [NSNumber numberWithBool:YES], OpenFeintSettingEnablePushNotifications,
                              [NSNumber numberWithBool:NO], OpenFeintSettingDisableUserGeneratedContent,
                              [NSNumber numberWithBool:NO], OpenFeintSettingAlwaysAskForApprovalInDebug,
#ifdef DEBUG
                              [NSNumber numberWithInt:OFDevelopmentMode_DEVELOPMENT], OpenFeintSettingDevelopmentMode,
#else
                              [NSNumber numberWithInt:OFDevelopmentMode_RELEASE], OpenFeintSettingDevelopmentMode,
#endif
                              window, OpenFeintSettingPresentationWindow,
#ifdef DEBUG
                              [NSNumber numberWithInt:OFDevelopmentMode_DEVELOPMENT], OpenFeintSettingDevelopmentMode,
#else
                              [NSNumber numberWithInt:OFDevelopmentMode_RELEASE], OpenFeintSettingDevelopmentMode,
#endif
                              nil
                              ];    
    [OpenFeint initializeWithProductKey:@"hgghf"
                              andSecret:@"nbvnb"
                         andDisplayName:@"ncvnv"
                            andSettings:settings
                           andDelegates:nil];

    [OpenFeint launchDashboard];

    OFGameFeedView * gameFeed = [OFGameFeedView gameFeedView];
    [rootVC.view addSubview:gameFeed];
}

Здесь разбитая раскладка iPad broken layout

1 Ответ

0 голосов
/ 07 октября 2011

Теперь он работает с этой конфигурацией. Ошибка была неправильной связкой. Это правильный вариант: OFResources_Universal.bundle.

Конфигурация теперь:

UIViewController * rootVC = [UIApplication sharedApplication].keyWindow.window.rootViewController;
    NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
                              [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight], OpenFeintSettingDashboardOrientation,
                              @"asdasdads", OpenFeintSettingShortDisplayName,
                              [NSNumber numberWithBool:YES], OpenFeintSettingGameCenterEnabled,
                              [NSNumber numberWithBool:YES], OpenFeintSettingEnablePushNotifications,
                              [NSNumber numberWithBool:NO], OpenFeintSettingDisableUserGeneratedContent,
                              [NSNumber numberWithBool:NO], OpenFeintSettingAlwaysAskForApprovalInDebug,
#ifdef DEBUG
                              [NSNumber numberWithInt:OFDevelopmentMode_DEVELOPMENT], OpenFeintSettingDevelopmentMode,
#else
                              [NSNumber numberWithInt:OFDevelopmentMode_RELEASE], OpenFeintSettingDevelopmentMode,
#endif
                              rootVC, OpenFeintSettingPresentationWindow,
#ifdef DEBUG
                              [NSNumber numberWithInt:OFDevelopmentMode_DEVELOPMENT], OpenFeintSettingDevelopmentMode,
#else
                              [NSNumber numberWithInt:OFDevelopmentMode_RELEASE], OpenFeintSettingDevelopmentMode,
#endif
                              nil
                              ];    
    [OpenFeint initializeWithProductKey:@"asdasdas"
                              andSecret:@"asdasdasd"
                         andDisplayName:@"asdasdsad"
                            andSettings:settings
                           andDelegates:nil];
...