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

PhilBlais picture PhilBlais · Jul 30, 2013 · Viewed 12k times · Source

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?

Answer

inket picture inket · Aug 2, 2013

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.