0

我成功地将 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破碎的布局

4

1 回答 1

0

它现在使用此配置运行。错误是错误的捆绑包。这是正确的: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];
于 2011-10-07T07:16:02.867 回答