我成功地将 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];
}
这里破碎的布局