小编Gur*_*uru的帖子

Cocos2d - SimpleAudioEngine - iPhone上没有播放声音

最近我在使用CocosDenshion播放我的声音效果时遇到了问题.声音在iPhone模拟器上播放,但不在我自己的设备上播放.我不确定我做错了什么.当然我检查了我的扬声器是否仍在工作,但他们在使用其他应用程序或iPod库时也是如此.

我只是使用这个简单的代码:

[[SimpleAudioEngine sharedEngine] playEffect:@"button.wav"];
Run Code Online (Sandbox Code Playgroud)

我仔细检查了文件的名称,它确实是button.wav.

我希望有人可以帮助我.

audio cocos2d-iphone simpleaudioengine

3
推荐指数
1
解决办法
7233
查看次数

减少背景音乐的音量

在我的应用程序中,我正在使用以下代码播放音乐.但我想减少背景音乐的音量.如何做到这一点.

谢谢,阿尼什

iphone objective-c cocos2d-iphone simpleaudioengine

2
推荐指数
1
解决办法
1521
查看次数

故事板不包含带标识符的视图控制器

我不断收到错误次:"故事板()不包含具有标识符'myWebView’视图控制器我使用的UITableView和当用户单击单元格,它会推动另外的看法,加载一个UIWebView但我相信我在storyboard中正确设置了标识符,请查看代码:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSArray *arrInfo = [[tableData objectAtIndex:indexPath.row] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@";"]];

favWebView *nextView = [self.storyboard instantiateViewControllerWithIdentifier:@"myWebView"];

nextView.title = [arrInfo objectAtIndex:1];
nextView.url1 = [arrInfo objectAtIndex:6];
[self.navigationController pushViewController:nextView animated:YES];
}
Run Code Online (Sandbox Code Playgroud)

图片:

在此输入图像描述 谁能告诉我如何解决这个问题?任何帮助将非常感激.

iphone identifier storyboard

2
推荐指数
1
解决办法
8548
查看次数

Cocos2D采用新的RevMobAds框架

在Cocos2D游戏中集成新的RevMob.frmework.

现在我的Cocos2D 1.0游戏中出现了很多编译错误,而其他cocos2D 2.0游戏中只有链接器错误.

在Cocos2D 2.0中,链接器错误是:

  "_SKStoreProductParameterITunesItemIdentifier", referenced from:
  "_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
Run Code Online (Sandbox Code Playgroud)

错过了哪个系统框架?已添加StoreKit.framework

在cocos2D 1.0中,连同这些链接器错误,也会产生一些编译错误.它显示"在*之前的预期属性属性,在下面一行(在RevMobAds.framewors中)

@property (nonatomic, strong) NSArray *supportedInterfaceOrientations;
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决所有这些问题并在cocos2d游戏中获得新的revMob sdk?

cocos2d-iphone revmob

2
推荐指数
1
解决办法
1226
查看次数

如何使用确切的框架和展示位置ID启动revmob横幅广告?

我尝试使用RevMob中建议的代码显示带有特定展示位置ID的横幅广告但未成功,尝试使用以下代码:

RevMobAds *revmob = [RevMobAds revMobAds];
        RevMobBanner *banner = [revmob bannerWithPlacementId:@"ID_FROM_REV_MOB"];
        [banner showAd];
Run Code Online (Sandbox Code Playgroud)

甚至尝试添加以下声明

if (IS_iPad) {
        banner.frame =  CGRectMake(0, 958, 768, 66);
    } else if (IS_WIDESCREEN){
        banner.frame = CGRectMake(0, 518, 320, 50);
    } else {
        banner.frame = CGRectMake(0, 430, 320, 50);
    }
Run Code Online (Sandbox Code Playgroud)

但没有成功,我能够展示横幅广告的唯一方法是:

[RevMobAds showBannerAdWithFrame:CGRectMake(0, 958, 768, 66) withDelegate:self];
Run Code Online (Sandbox Code Playgroud)

但是添加展示位置ID无济于事.

iphone xcode ipad ios revmob

2
推荐指数
1
解决办法
3293
查看次数

Cocos2d 3.0设置纵向

已经在AppDelegate.m中添加了以下代码,但仍然没有在纵向工作.

-(NSUInteger)supportedInterfaceOrientations {
  return UIInterfaceOrientationMaskPortrait;

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
Run Code Online (Sandbox Code Playgroud)

这是Xcode摘要页面: 在此输入图像描述

cocos2d-iphone

2
推荐指数
1
解决办法
2031
查看次数

在cocos2d中按顺序播放声音

如何按顺序在cocos2d中播放声音,任何身体都有任何想法,例如我有三个声音

[[SimpleAudioEngine sharedEngine] playEffect:[CommanMethods GetCompleteSoundPath:objplate.OrderOneSound]];

[[SimpleAudioEngine sharedEngine] playEffect:[CommanMethods GetCompleteSoundPath:objplate.WithSound]];

[[SimpleAudioEngine sharedEngine] playEffect:[CommanMethods GetCompleteSoundPath:objplate.OrderTwoSound]];
Run Code Online (Sandbox Code Playgroud)

这是声音效果播放的代码,当一个人停下来然后再播放之后我怎么玩

iphone cocos2d-iphone xcode4.2 simpleaudioengine

1
推荐指数
1
解决办法
2133
查看次数

奇怪的是,在编辑模式下的UITableViewCell中,重新排序单元格

在此输入图像描述

我正处于编辑模式.深灰色是一个imageView,它似乎被重新排序图标推动,你可以在背景中看到UIview(浅灰色).

我不喜欢这种情况发生.

你怎么看?

iphone objective-c uitableview

0
推荐指数
1
解决办法
1185
查看次数

风景中的Nextpeer只有iphone游戏

我在肖像游戏中使用了Nextpeer并且工作正常.在横向游戏中使用相同的代码,但Nextpeer仪表板仍处于纵向模式.如何将Nextpeer仪表板方向更改为横向?

这是我的Nextpeer初始化代码:

-(void)initializeNextpeer:(NSDictionary *)launchOptions
{
    if([self internetConnected])
    {
        BOOL isRetina = (IS_IPAD) ? FALSE : TRUE ;

        NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:

                                  // This game has no retina support - therefore we have to let the platform know
                                  [NSNumber numberWithBool:isRetina], NextpeerSettingGameSupportsRetina,
                                  // Support orientation change for the dashboard notifications
                                  [NSNumber numberWithBool:TRUE], NextpeerSettingSupportsDashboardRotation,
                                  // Support orientation change for the in game notifications
                                  [NSNumber numberWithBool:TRUE], NextpeerSettingObserveNotificationOrientationChange,
                                  //  Place the in game notifications on the bottom screen (so the current score …
Run Code Online (Sandbox Code Playgroud)

iphone landscape cocos2d-iphone nextpeer

0
推荐指数
1
解决办法
344
查看次数

Pushwhoosh远程通知

我们使用Pushwhoosh进行远程通知.它的工作正常,但Icon徽章计数没有增加.

这是代码:

- (void) onPushReceived:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart
{
    [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
    [[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:  (UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge)];

     PushNotificationManager * pushManager = [PushNotificationManager pushManager];
    pushManager.delegate = self;

    if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]) {
        PushNotificationManager * pushManager = [PushNotificationManager pushManager];
        [pushManager startLocationTracking];
    }

    [[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
    [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
}
Run Code Online (Sandbox Code Playgroud)

推送时如何增加应用程序图标徽章计数?

iphone objective-c ios pushwoosh

0
推荐指数
1
解决办法
2313
查看次数