lyspring / adwhirl

Automatically exported from code.google.com/p/adwhirl
0 stars 0 forks source link

Unrecognised selector sent to instance #276

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am having issues adding AdWhirl to an old iPhone project.

I am currently seeing a crash where the following is printed in the console:
*** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, 
reason: ‘-[UIPlaceHolderColor initWithDict:]: unrecognised selector sent to 
instance 0x7101a0

The line which is crashes on is within AdWhirlConfig.m::parseExtraConfig when 
attempting to allocate memory for backgroundColour:
backgroundColor = [[UIColor alloc] initWithDict:(NSDictionary *)bgColor];

As far as I am aware everything is set up correctly. We are only using iAds and 
AdMob. All other adapters have been excluded. All frameworks added.

Out of curiosity, I attempted to comment out this line and another similar 
offender. The code is then unable to create an adapterClass. A message is then 
printed to the console along the lines of:
Cannot create ad network config from {
Key: ...;
Nid = ...;
Nname = iAd;
Priority = 2;
Type = 19;
Weight = 50;
}: Ad network type 19 not supported, no adapter found.

This code will be printed twice, the second will be the failed adMob attempt.

There is a good chance that these are two separate problems altogether. But I 
would appreciate any input if anyone has any ideas. 

Note: As part of updating the project, a view controller has been added. Does 
the view controller have to be set up in any specific way? The rest of the app 
is displayed as expected so I doubt this is the issue. 

Original issue reported on code.google.com by chrishul...@gmail.com on 5 Jan 2012 at 6:08

GoogleCodeExporter commented 8 years ago
Forgot to mention, this was using the latest AdWhirl SDK: 3.1.1

Original comment by chrishul...@gmail.com on 5 Jan 2012 at 6:49

GoogleCodeExporter commented 8 years ago
Are you sure you're including UIColor+AdWhirlConfig.{h,m} in your build target? 
 These files extend UIColor to add the initWithDict method.

For the second, can you double check the inclusion of AdWhirlAdapterIAd, and 
make sure that you're including the iAd framework in your project?

Original comment by wesgood...@google.com on 5 Jan 2012 at 8:23

GoogleCodeExporter commented 8 years ago

Original comment by wesgood...@google.com on 5 Jan 2012 at 8:24

GoogleCodeExporter commented 8 years ago
Thanks for your help.

Its now working. We have a network library where all the adwhirl/admob code 
exists. This is then used by our main project. The files you mentioned were all 
included within the network library but not the main project.

Still seems a little strange, but am now including certain the following in the 
main project:
AdWhirlAdapterGoodAdMobAds.m/h
AdWhirlAdapterIAd.m/h
UIColor+AdWhirlConfig.m

Original comment by chrishul...@gmail.com on 6 Jan 2012 at 11:13

GoogleCodeExporter commented 8 years ago
Sweet, glad to hear that got everything working for you.

Original comment by wesgood...@google.com on 6 Jan 2012 at 8:11

GoogleCodeExporter commented 8 years ago
Hi!

That helped me to resolve the same issue, but it is very unpleasant. I would 
like to have all AdWhirl code in a separate library, so we can share it between 
projects. Isn't there any way to accomplish that?

Thanks!

Original comment by joshybl...@gmail.com on 30 Mar 2012 at 10:22