larsacus / LARSAdController

Lightweight ad mediation for iOS to properly manage multiple ad networks dynamically including iAd and Google ads.
http://theonlylars.com/blog/2013/01/10/stupid-easy-ads-with-larsadcontroller-3-dot-0/
MIT License
269 stars 60 forks source link

avoid multiple registration for the same KVO event #85

Closed haifengkao closed 10 years ago

haifengkao commented 10 years ago

see https://github.com/larsacus/LARSAdController/issues/84

haifengkao commented 10 years ago

No, the logic is different. If justCreated == NO, it means the KVO event (of adLoaded) has been registered in previous startAdNetworkAdapterClass:. If you don't check the value of justCreated, the same KVO event will be registered again.

Just call startAdNetworkAdapterClass: multiple times and you will see multiple observeValueForKeyPath:ofObject: being invoked when adLoaded changes its value. I don't think it is your intention.

larsacus commented 10 years ago

Declining in favor of #86