最近我在使用CocosDenshion播放我的声音效果时遇到了问题.声音在iPhone模拟器上播放,但不在我自己的设备上播放.我不确定我做错了什么.当然我检查了我的扬声器是否仍在工作,但他们在使用其他应用程序或iPod库时也是如此.
我只是使用这个简单的代码:
[[SimpleAudioEngine sharedEngine] playEffect:@"button.wav"];
Run Code Online (Sandbox Code Playgroud)
我仔细检查了文件的名称,它确实是button.wav.
我希望有人可以帮助我.
在我的应用程序中,我正在使用以下代码播放音乐.但我想减少背景音乐的音量.如何做到这一点.
谢谢,阿尼什
我不断收到错误次:"故事板()不包含具有标识符'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)
图片:
谁能告诉我如何解决这个问题?任何帮助将非常感激.
在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?
我尝试使用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无济于事.
已经在AppDelegate.m中添加了以下代码,但仍然没有在纵向工作.
-(NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
Run Code Online (Sandbox Code Playgroud)
这是Xcode摘要页面:

如何按顺序在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)
这是声音效果播放的代码,当一个人停下来然后再播放之后我怎么玩

我正处于编辑模式.深灰色是一个imageView,它似乎被重新排序图标推动,你可以在背景中看到UIview(浅灰色).
我不喜欢这种情况发生.
你怎么看?
我在肖像游戏中使用了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) 我们使用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 ×7
objective-c ×3
ios ×2
revmob ×2
audio ×1
identifier ×1
ipad ×1
landscape ×1
nextpeer ×1
pushwoosh ×1
storyboard ×1
uitableview ×1
xcode ×1
xcode4.2 ×1