PDA

View Full Version : More iOS 6.0 troubles




samdev
Sep 20, 2012, 02:10 AM
Just downloaded XCode 4.5 and iOS 6.0, and already experiencing some troubles after compiling my app.
I'm using the simulator.

First, ADBannerView is not firing anymore when there isn't an Internet connection.
Specifically, didFailToReceiveAdWithError is not being called. This can be used to hide
your banner if it's not needed.

Secondly, I'm playing some sound effects using OpenAL, and maybe after 5 minutes or so,
all of my sounds start to become corrupt. They sound like their being crunched to death.
Really horrible.

And already posted a thread on getting some unexpected behavior from sizeToFit.

This is all on the iOS 6.0 simulator. No problems on iOS 5.0.

Just wondering if anybody is experiencing the same problems.



Reason077
Sep 20, 2012, 05:03 AM
I have not seen any problems with ADBannerView in iOS 6. didFailToReceiveAdWithError is called for me when there is no internet connection.

dejo
Sep 20, 2012, 09:27 AM
I, too, am getting a frequent
ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:)

samdev
Sep 20, 2012, 10:51 AM
I, too, am getting a frequent
ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:)

That sounds like a different problem than mine.

With iOS 5, didFailToReceiveAdWithError is continuously called when there is no Internet connection.
Now, with iOS 6.0, it's never called.

And the problem with sounds is even worst. If I leave my app running for maybe 10 or more minutes, the sound completely goes silent.

It's like a slow death.

Prohapps
Sep 20, 2012, 03:07 PM
What does your code look like ?

samdev
Sep 20, 2012, 05:08 PM
What does your code look like ?

I don't see anything wrong with my banner code.

To get it compiled with iOS 6.0, I had to comment out two lines.


@interface MyViewController : UIViewController <ADBannerViewDelegate> {


Allocate banner and add it to the view:

ADBannerView *tmp = [[ADBannerView alloc] initWithFrame:CGRectZero];
tmp.frame = CGRectOffset(tmp.frame, 0, -50);
tmp.delegate = self;

// Depreciated in iOS 6.0
//tmp.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
//tmp.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;

[self.view addSubview:tmp];
[tmp release];


Delegate methods added:

-(void)bannerViewDidLoadAd:(ADBannerView *)banner;
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error;

samdev
Sep 20, 2012, 11:01 PM
I have not seen any problems with ADBannerView in iOS 6. didFailToReceiveAdWithError is called for me when there is no internet connection.


More specifically, didFailToReceiveAdWithError is not being called when the simulator device
is set to iPhone (Retina 3.5-inch) or iPhone (Retina 4-inch).

I see that ADBannerView has a new initializer called initWithAdType, so I tried that and
it still doesn't get called.

The iOS 5.0 simulator will also crash if calling initWithAdType, so I tried the following:


ADBannerView *tmp = NULL;

if( [tmp respondsToSelector:@selector(initWithAdType:)]) {
tmp = [[ADBannerView alloc] initWithAdType:ADAdTypeBanner]; // iOS 6.0
}
else {
tmp = [[ADBannerView alloc] initWithFrame:CGRectZero]; // iOS 5.0
}


But the respondsToSelector line does not return YES when running iOS 6.0.
I don't know why.

Reason077
Sep 21, 2012, 08:52 AM
Upon further investigation, my app doesn't appear to be receiving any iAds (or test iAds) with iOS 6. Test Ads were working fine in the iOS 6 betas, but now not in the GM. Ads still working fine on 4.3.5 and 5.1.1.

My didFailToReceiveAdWithError is firing, however, giving either "Unknown Error" or "Ad inventory unavailable".

nickculbertson
Sep 21, 2012, 12:15 PM
I think we are all in the same boat. There is much discussion on this in the apple devforums. Apparently some developers experienced similar problems when iOS 5 came out (I don't remember having any though). Apple gains revenue from those ads as well. Things will probably be fixed soon. Between iOS 6, iPhone 5 release, botched map app, and now this I'd say their hands are pretty full at the moment.

samdev
Sep 21, 2012, 08:20 PM
Well, putting the first problem aside, is this the correct way to use respondsToSelector ?

I need to initialize ADBannerView for both iOS 5 and 6, and initWithAdType only exists on iOS 6.
But, it's not working. The respondsToSelector line doesn't return "YES".

Reason077
Sep 22, 2012, 07:41 AM
Well, putting the first problem aside, is this the correct way to use respondsToSelector ?

I need to initialize ADBannerView for both iOS 5 and 6, and initWithAdType only exists on iOS 6.
But, it's not working. The respondsToSelector line doesn't return "YES".

There isn't any reason why you need to use initWithAdType, is there? The banner type is the default anyway. Just dont use it if you want the app to be backwards-compatible.

PhoneyDeveloper
Sep 22, 2012, 12:33 PM
@samdev, you're asking

if( [NULL respondsToSelector:@selector(initWithAdType:)])

and the answer is NO. NULL doesn't respond to any selectors.

You probably need something like:

if( [[ADBannerView class] instancesRespondToSelector:@selector(initWithAdType:)])

but I haven't used this view.

samdev
Sep 22, 2012, 03:56 PM
@samdev, you're asking

if( [NULL respondsToSelector:@selector(initWithAdType:)])

and the answer is NO. NULL doesn't respond to any selectors.

You probably need something like:

if( [[ADBannerView class] instancesRespondToSelector:@selector(initWithAdType:)])

but I haven't used this view.

Thanks, that makes sense now.


There isn't any reason why you need to use initWithAdType, is there? The banner type is the default anyway. Just dont use it if you want the app to be backwards-compatible.

I was thinking I had to call initWithAdType with iOS 6.0, otherwise my banner would be locked in portrait mode.
But I guess that doesn't matter.