Domanda

It appears my best option to configure my application differently depending on whether it is running in the simulator or a device is to have environment-specific prefix headers.

In order to apply a different prefix-header I need to have an entire separate target for each environment - one for local/simulator deployment and one for device deployment.

This means I am left with two almost identical targets to maintain which is a maintenance headache. So how can I improve this setup. Is there a way to create sub-targets or somehow derive two targets from the same parent target?

È stato utile?

Soluzione

You don't need to create new target, just use this at your *Prefix.pch

#if !TARGET_IPHONE_SIMULATOR
//  device headers
#else
//  simulator headers
#endif
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top