Мое приложение недавно было отклонено, потому что две мои сторонние библиотеки используют платформу AdSupport
, и Apple не смогла найти никаких баннеров «Apple-Ad» в любом месте, когда они ее тестировали. Поэтому я обновил свой код и разместил ADBannerView
как subview
на ячейке в моем UITableView
.Место ADBanner on UITableViewCell
Но это, кажется, не работает, и я получаю коды ошибок, как
ADErrorDomain Code 4: App имеет ошибки конфигурации IAD и другие ошибки ..
Когда я добавить вид баннера как subview
из a UIViewController
s взгляд, он работает очень хорошо.
Есть проблемы с этим, или я не могу поместить объявление на UITableViewCell
? Или есть способ разместить ADBannerView
на ячейке просмотра таблицы?
EDIT:
я помещаю ADBannerView
так же, как в этом учебнике. http://www.raywenderlich.com/1371/iad-tutorial-for-ios-how-to-integrate-iad-into-your-iphone-app
EDIT 2:
этого тест-код для проверки, если интеграция ОВР работает, как ожидалось.
// это для построения вид таблицы ячейки
- (void) initializeAllAdTableViewCells {
[self initializeAdTableViewCellWithRow:1 inSection:0];
[self initializeAdTableViewCellWithRow:4 inSection:0];
[self initializeAdTableViewCellWithRow:5 inSection:0];
}
- (void) initializeAdTableViewCellWithRow:(NSUInteger) row inSection:(NSUInteger) section {
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]];
ADBannerView *adView = [[ADBannerView alloc] initWithAdType:ADAdTypeBanner];
adView.backgroundColor = [UIColor clearColor];
[cell addSubview:adView];
//store ad tableViewCell for later
[self internalRegisterAdTableViewCell:cell withRow:row inSection:section];
adView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
adView.delegate = self;
[adView release];
[cell autorelease]
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
int adCellCount = [[self adCellsForSection:section] count];
return [data count] + adCellCount;
}
- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self adCellForRow:indexPath.row inSection:indexPath.section];
if (cell == nil) {
//create other cells
}
return cell;
}
Возможно, какой-то код на том, что вы пробовали? –