I wouldn't key off of the provisioning profile for changing environments. Provisioning profiles change often (need to generate new development ones whenever a new device is registered, they expire every 12 months, etc.)
I would set up different build configs in your project that correspond to the different regions. Then you could change the region settings at compile time using preprocessor directives.
Step by step:
- Project menu -> Edit Project Settings -> Build tab
- Select All Configurations
- Scroll down to GCC 4.0 - Preprocessing
Add the following to Preprocessor Macros Not Used in Precompiled Headers:
CONFIGURATION_$(CONFIGURATION)
Assuming you have Debug, Adhoc and Release configurations, this will generate preprocessor macros for each configuration.
CONFIGURATION_Debug
CONFIGURATION_Adhoc
CONFIGURATION_Release
Then, in your code you can key off of these configurations to configure your regions.
#if defined (CONFIGURATION_Debug) || defined (CONFIGURATION_Adhoc)
NSLog( @"Warning message");
#endif
You can get more details into this technique here.
If you still want to inspect the provisioning profile (after build, it would be copied to the the embedded.mobileprovision), you could use something like this. The only scenario I could see this providing a benefit is if you resign the binary after you build it and would like the re-signed binaries to change regions.