Here's an entry in my config file...
This gets picked up correctly in build settings...
I've referenced the setting in both Info.plist files for the project...
But upon execution of the test target, the value isn't there...
Any ideas?
Here's an entry in my config file...
This gets picked up correctly in build settings...
I've referenced the setting in both Info.plist files for the project...
But upon execution of the test target, the value isn't there...
Any ideas?
The code was looking in the wrong bundle.
This answer gave me the solution...
https://mcmap.net/q/126327/-why-can-39-t-code-inside-unit-tests-find-bundle-resources
This was the code I used instead...
let urlString = NSBundle(forClass: self.dynamicType).objectForInfoDictionaryKey("WebServiceUrl") as? String
I only needed the entry in the Info.plist for my test target which is where the above code was defined.
Additionally, I didn't need quotes around the value in the config file.
© 2022 - 2024 — McMap. All rights reserved.
WebServiceUrl
to all target's build settings, or just the "Resolved" target? – Penitentiary