Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After implementing iAd getting ERROR: unable to get the receiver data from the DB

Tags:

ios7

iad

I implemented a very simple iAd banner in totally new project and when I run it I'm getting the error ERROR: unable to get the receiver data from the DB!

The code is pretty basic, so I don't think the problem is code related, but I will add it just in case:

#import <iAd/iAd.h>

@interface MainViewController : UIViewController <ADBannerViewDelegate>
{ADBannerView *adView;}
@property (retain, nonatomic) IBOutlet ADBannerView *adView;

@end

@implementation MainViewController
@synthesize adView;

- (void)viewDidLoad
{
    [super viewDidLoad];
    adView.delegate = self;
    [adView setHidden:YES];
}

-(void)bannerViewDidLoadAd:(ADBannerView *)banner{
    [adView setHidden:NO];
    NSLog(@"is laoding");
}

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
    [adView setHidden:YES];
    NSLog(@"is NOT loading");
}

@end

Anyone else getting this error? Any help on this matter?

like image 219
PhilBlais Avatar asked Jul 30 '13 17:07

PhilBlais


2 Answers

The files in ~/Library/Caches/<your_apps_bundle_identifier>/ are probably corrupted. Delete the folder and try again.

Long story: I wasted whole hours looking for the source of those messages, even adding symbolic breakpoints for NSLog/write/print and shrugging it off as an Xcode bug since I'm running Xcode 5 too. But then it hit me... I was crash testing the launch of my app earlier today and the "Reopen windows" alert kept popping up so I figured that was probably the cause of those errors: turned out the cache files were corrupted.

like image 120
inket Avatar answered Oct 24 '22 08:10

inket


This happens to me after migrating from ASI to AFNetworking. And it didnt go away even after I cleared the project build and ca This is something to do with Cacheing policy, In regards to NSURLRequest

    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:120];

//OR

    [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
like image 26
Chamira Fernando Avatar answered Oct 24 '22 06:10

Chamira Fernando