從我的理解來看,iAds是用html5,js和css3製作的 - 因此我假設將它驅動的代碼下載到設備上進行顯示。如果我的ipad與我的筆記本電腦在同一無線網絡上,我會如何將它下載到我的筆記本電腦以查看它是如何工作的?如何爲iAd下載代碼
0
A
回答
0
我不確定您是否能或如何下載iAd,但您應該看看iAd Producer https://developer.apple.com/iad/iadproducer/,它可以爲您提供足夠的示例來了解它的工作原理。
1
您是否在將應用程序部署到應用程序商店之前嘗試進行iAD測試?您的iAds與您的Apple開發者帳戶配合使用,因此在將應用程序上傳到商店之前只需要您的代碼簽名。回答你的問題,如果你想測試是否網絡成癮者可與一般廣告,繼承人如何去杜安代碼:
在您的視圖控制器的.h文件中
#import "iAd/ADBannerView.h" //Add the iAd.framework to your Build
@interface YourViewController: UIViewController <ADBannerViewDelegate> {
//Dont forget to add the delegate
BOOL bannerDisplayed;
}
然後在.m文件
- (void) viewDidLoad {
ADBannerView *adBanner = [[ADBannerView alloc] initWithFrame:CGRectMake(0, -50, 320, 50)];
adBanner.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
adBanner.delegate = self;
[self.view addSubview:adBanner];
}
- (void) bannerViewDidLoadAd:(ADBannerView *)banner {
if(!bannerDisplayed) {
NSLog(@"iAd Banner Appear");
[UIView beginAnimations:@"bannerAppear" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, 411);
[UIView commitAnimations];
bannerDisplayed = YES;
} else {
NSLog(@"iAd Banner Appear Error. Not a FailAdWithError.");
}
}
- (void) bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
if(bannerDisplayed) {
NSLog(@"Banner Error. Remove Ad from Screen");
[UIView beginAnimations:@"bannerDisappear" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, -411);
[UIView commitAnimations];
bannerDisplayed = NO;
}
}
蘋果要求的iAd能夠刪除/隱藏自身櫃面發生錯誤時,你的iAd實例不會檢索廣告。因此,可能需要一兩秒鐘才能顯示出來,然後自行刪除以模仿成功或失敗。
相關問題
- 1. 如何下載Chromium源代碼?
- 2. 我該如何下載Android源代碼
- 3. 如何從ubersvn下載代碼?
- 4. 如何通過git下載源代碼?
- 5. 如何下載BIRT的源代碼?
- 6. 如何僅下載Android ICS源代碼
- 7. 如何下載網站的源代碼
- 8. 如何下載GCC源代碼?
- 9. 如何下載code.google.com的源代碼
- 10. 如何下載wordpress源代碼?
- 11. 如何下載此源代碼文件?
- 12. 如何下載Eclipse的源代碼?
- 13. 如何使用TortoiseHg(Mercurial)下載代碼
- 14. 如何從code.google.com下載源代碼
- 15. 如何使用bazaar下載源代碼?
- 16. 如何下載寶石代碼?
- 17. 如何執行代碼背景下載?
- 18. 如何從源代碼下載頁面
- 19. WSO2 ESB如何下載源代碼
- 20. 如何下載cryengine V的源代碼?
- 21. 如何下載Cassini Webserver的源代碼?
- 22. 如何下載aptoide的源代碼?
- 23. 下載代碼expalanation
- 24. 如何從谷歌代碼下載源代碼?
- 25. 如何從谷歌代碼網站下載示例代碼?
- 26. 如何將此下載的代碼轉換爲CodeDOM?
- 27. 如何爲node.js編寫以下代碼?
- 28. iOS 4中iAd的示例代碼
- 29. 如何限制我的iAd加載?
- 30. 如何強制iAd不加載?
我見過iAd製作人,但沒有看到有任何例子 - 你能詳細說明嗎? – nuway 2012-08-03 17:03:04