ios - ios7: adding iAd.framework to a project causes SIGABRT on run -


i have project working fine. want incorporate ads , make free version. i've copied project, renamed , added iad.framework. has caused sigabrt on run.

debugging not explain anything... crashes on setting vc properties viewdidload method of root vc. not think relevant, can provide details if think otherwise.

is there trick in linking iad? in advance!

edit: logs , clarification added

2014-04-25 16:04:04.249 myapptest[686:60b] -[mpviewcontroller setsoundname:]: unrecognized selector sent instance 0x16e43a30

2014-04-25 16:04:04.252 myapptest[686:60b] * terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[mpviewcontroller setsoundname:]: unrecognized selector sent instance 0x16e43a30'

it complains on non-recognized selector (property setter, precise). did not change apart linking iad.framework. , if remove framework, starts working fine again.

after more tracing, i've figured out that, iad framework, [self.storyboard instantiateviewcontrollerwithidentifier:@"mppagecontentcontroller"]; returns view controller of improper type, not nil!

mpviewcontroller *pagecontentviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"mppagecontentcontroller"]; if ([pagecontentviewcontroller iskindofclass:[mpviewcontroller class]]) {     nslog(@"ok"); } 

the test passed when iad.framework deleted, , fails otherwise! advice?

edit2: real glitch! i've updated test following:

    mpviewcontroller *pagecontentviewcontroller = (mpviewcontroller*)[self.storyboard instantiateviewcontrollerwithidentifier:@"mppagecontentcontroller"];     if ([pagecontentviewcontroller iskindofclass:[mpviewcontroller class]]) {         nslog(@"ok");     } else {         nslog(@"%@", [pagecontentviewcontroller description]);     } 

and, in case iad added project, following logged in console: " mpviewcontroller: 0xa63fd30 "

and see required mpviewcontroller properties in variables view panel in debug mode, though claimed unrecognised... it's becoming more , more weird, i'm running out of ideas move forward! help?

the reason why app crashed apple has class called mpviewcontroller can see here.

changing viewcontroller's class name solves issue.

i assume iad internally uses class display ads. compiler decided use apples class instead of yours , therefore got does not respond selector exception since apple's mpviewcontroller not respond selector.


you can see idea conform cocoa naming conventions , prefix classes 3 letters. can't find reference right remember (or said) 2 letter prefixes reserved apple classes.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -