The approach you use is correct. However, remember that each goal can have its own settings that override the project settings. Make sure the target does not override PRODUCT_NAME.
To do this, select the project in the Xcode project browser, then select the target. Each target has its own build settings. Change PRODUCT_NAME in the same way as when editing project build settings.
source share