#ipad #layout #cocos2d-iphone #openfeint
#iPad #макет #cocos2d-iphone #openfeint
Вопрос:
Я успешно интегрировал 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];
}
Здесь сломанный макет
Ответ №1:
Теперь он работает с этой конфигурацией. Ошибка заключалась в неправильном наборе. Это правильный вариант: 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];