任何人都可以提供一点帮助吗?我刚刚收到来自 Apple 的反馈,建议我的应用程序无法被接受,因为它包含在没有提供广告时仍然可见的广告横幅,问题是我不知道该怎么做才能防止这个问题。
[引用]
我们已完成对您申请的审核;但是,我们无法将此版本发布到 App Store,因为当广告内容不可用时,它会显示一个空的 iAd 横幅。当 iAd 不提供广告内容时,应隐藏应用程序中的横幅。我们在下面提供了其他详细信息,以帮助解释该问题。我们希望您考虑修改并重新提交您的申请。
要处理广告内容不可用的情况,您需要实现横幅视图委托。为方便起见,此处包含示例代码片段。此外,您可能希望查看 iAd 编程指南的“使用横幅视图”部分以了解具体细节: https ://developer.apple.com/iphone/prerelease/library/documentation/UserExperience/Conceptual/iAd_Guide/WorkingwithBannerViews/ WorkingwithBannerViews.html
横幅视图委托在广告不可用时删除横幅视图:
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
if (self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
// assumes the banner view is at the top of the screen.
banner.frame = CGRectOffset(banner.frame, 0, -50);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
现在我正在努力解决的是如何处理该代码,当我尝试将其放入其中时只会抛出几个红色错误,所以我来寻求建议,任何人都可以在这里帮助我吗?
编辑:海报要求的主视图控制器代码
//
// MainViewController.m
// GBSoundboard4
//
// Created by David Clarke on 19/06/2010.
// Copyright __MyCompanyName__ 2010. All rights reserved.
//
#import "MainViewController.h"
#import <AVFoundation/AVAudioPlayer.h>
@implementation MainViewController
-(IBAction)goodafternoon {
NSString *path = [[NSBundle mainBundle] pathForResource:@"goodafternoon" ofType:@"wav"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[theAudio play];
}
-(IBAction)jollygood {
NSString *path = [[NSBundle mainBundle] pathForResource:@"jollygood" ofType:@"wav"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[theAudio play];
}
-(IBAction)playSound {
NSString *path = [[NSBundle mainBundle] pathForResource:@"goodmorning" ofType:@"wav"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[theAudio play];
}
-(IBAction)upgrade {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/gb/app/the-great-british-soundboard/id376263018?mt=8"]];
}
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/
- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller {
[self dismissModalViewControllerAnimated:YES];
}
- (IBAction)showInfo:(id)sender {
FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc. that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/
- (void)dealloc {
[super dealloc];
}
@end