これについて少し助けを提供できる人はいますか?Appleから、広告が配信されていないときにまだ表示されているアドバナーが含まれているため、アプリを受け入れられないというフィードバックを受け取りました。問題は、この問題を防ぐために何をすべきかわからないことです。
[引用]
アプリケーションのレビューが完了しました。ただし、広告コンテンツが利用できない場合は空のiAdバナーが表示されるため、このバージョンをAppStoreに投稿することはできません。広告コンテンツが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