larsacus/TOLDeveloperAds — pull request #16 by mrcmd (2014-07-27 13:03:59+00:00)
Title: Set default country code to avoid crash

countryCode of NSLocale can be nil. App will crash:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(
0 CoreFoundation 0x0000000106432495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010368c99e objc_exception_throw + 43
2 CoreFoundation 0x00000001063fbdce -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 382
3 CoreFoundation 0x000000010642723f +[NSDictionary dictionaryWithObjects:forKeys:count:] + 63
4 APP iOS 0x0000000100035389 -[TOLDeveloperAds fetchDeveloperMetadataWithSuccess:failure:] + 569
5 APP iOS 0x000000010003255e -[TOLDeveloperAds requestNextAdBanner] + 542
6 APP iOS 0x00000001000382b7 -[TOLDeveloperAds startAdRequests] + 231
7 APP iOS 0x000000010003fc57 -[LARSAdController startAdNetworkAdapterClass:] + 1463
8 APP iOS 0x000000010003f659 -[LARSAdController startAdNetworkAdapterClassAtIndex:] + 473
9 APP iOS 0x000000010003b129 -[LARSAdController addAdContainerToView:withParentViewController:] + 473

Steps to reproduce: set region format to Esperanto:
Settings > General > International > Region Format > Esperanto