16

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?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
PhilBlais
  • 1,076
  • 4
  • 13
  • 36
  • I think this is not related to iAd, are you using this log anywhere in your code ? – Midhun MP Jul 30 '13 at 17:41
  • That's the thing, what I posted is all the code there is. I even tried to create 2 new projects and I still get that error. I wasn't getting that in xcode 5 beta 3 ... it only started with beta 4. – PhilBlais Jul 30 '13 at 18:00

2 Answers2

16

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.

inket
  • 1,641
  • 16
  • 21
  • 1
    i "cleaned" my project and the build did not break anymore this way, but the error message does still appear in the logs. – alexdd55 Sep 06 '13 at 21:06
10

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];
Chamira Fernando
  • 6,836
  • 3
  • 23
  • 23
  • 3
    This is kinda wrong. cachePolicy take a NSURLRequestCachePolicy enum type. However, you have 'NSURLCacheStorageAllowedInMemoryOnly', which is a NSURLCacheStoragePolicy enum type, which evaluate to 1. So you are actually using NSURLRequestReloadIgnoringLocalCacheData. Thus there's no error, because you are not using cache at all. – Michael Ozeryansky Apr 18 '14 at 05:30
  • Ya it should be NSURLRequestReloadIgnoringLocalCacheData.. Thanks for mentioning :) – Chamira Fernando Apr 22 '14 at 10:46