2014-02-05 2 views
1

내 타사 라이브러리 중 두 개가 AdSupport 프레임 워크를 사용하고 있기 때문에 내 앱이 최근에 거부되었습니다. Apple은 테스트 할 때 어디서나 "Apple-Ad"배너를 찾을 수 없었습니다. 따라서 코드를 업데이트하고 UITableView에있는 셀에 subview으로 ADBannerView을 삽입했습니다.UITableViewCell에 ADBanner 넣기

하지만이 일을하고 내가 좋아하는 에러 코드를 얻을하지 않는 것

ADErrorDomain 코드 4 : 응용 프로그램이 IAD 구성 오류 및 기타 오류가 ..

내가의 subview으로 배너보기를 추가

a UIViewController보기, 꽤 잘 작동합니다.

광고에 문제가 있습니까? UITableViewCell에 광고를 게재 할 수 없습니까? 또는 ADBannerView을 표보기 셀에 배치 할 수 있습니까?

편집 :

내가 그냥 튜토리얼 같은 ADBannerView를 놓습니다. http://www.raywenderlich.com/1371/iad-tutorial-for-ios-how-to-integrate-iad-into-your-iphone-app

편집 2 :

예상대로 말게 통합이 작동하는 경우에, 확인하기 위해 테스트 코드를 IT.

는 //이 테이블 뷰 셀

- (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; 
} 
+0

아마도 당신이 시도한 코드 중 일부입니까? –

답변

0

당신은 AdBannerView을 발표하고 그것은 아마 당신이 그렇게하기 전에보기에 광고를로드 할 수있는 기회가되지 않았습니다 구축을위한 것입니다. 수업을 광고 위임자로 설정하고 광고를 사용할 수있게되면 광고를 표에 삽입 한 다음 광고가없는 경우 해당 행을 삭제할 수 있습니다. 광고가 항상 제공되는 것은 아니므로 - bannerViewDidLoadAd를 사용하십시오.

+0

자, 코드를 업데이트했습니다. 그것은 TableViewCell을 생성하고 사전에 광고 TableViewCell을 저장하며, 테이블 뷰 빌드를 기반으로합니다. – NicTesla

+0

AdBannerView를 사용하고 싶을 때까지 AdBannerView를 계속 출시하고 있습니다. 광고가 표시되기를 원하는 한 그것에 대한 참조를 보유해야합니다. – brussell

+0

TableView에 ADBannerView를 추가하여 참조를 유지합니다. [셀 adSubview : adView]; ADBannerView의 보유자 수가 증가하고 있습니다. 그리고 대리자를 통해 오류 메시지를받습니다. – NicTesla

관련 문제