0

I am trying to implement an adWhirl view in the same view as one that has an MKMapView object. If I follow the standard steps that work fine with my tableViews, that is

awView = [AdWhirlView requestAdWhirlViewWithDelegate:self]; 
[self.view addSubview:awView];

then the funny behavior starts. In the simulator it receives the touch and sends you on. But when running on my test device (running 3.1.3) the touch passes through to the map.

I have been told that this is because awView is being cast as a subView of mapView and that it must be its own view. But how? I have tried creating a separate UIView and then placing awView in it, then locating it at a fixed location, but instead of the fixed location, it loads relative to mapView and still does not receive touches.

Any suggestions?

Addendum: I thought that I was adding both as subviews but have not had any success. What I had done is to create two views in IB. The top one (firstView) has two subviews (bannerForAd and mapView.) This is what I have now

self.awView = [AdWhirlView requestAdWhirlViewWithDelegate:self];
self.awView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
[bannerForAd addSubview:awView];

mapView = [[MKMapView alloc] initWithFrame:self.view.frame];
mapView = (MKMapView*)self.view;
mapView.delegate = self;

[firstView addSubview:mapView];
[firstView bringSubviewToFront:bannerForAd];

Now the map shows fine, but the ad is not even visible.

LancDec
  • 70
  • 2
  • 7

1 Answers1

0

Stick both the AdWhirlView and the MKMapView as a subview of a UIView.

tc.
  • 33,468
  • 5
  • 78
  • 96
  • I added more details of my attempt at creating two subviews in my original post – LancDec Nov 21 '10 at 06:41
  • I have tried to do this various ways using both IB and programmatically and I have gotten no where. This shouldn't be that difficult. Do you have a few lines of code that might help me to see where I am going wrong? – LancDec Nov 21 '10 at 20:48