I would recommend the following:
- Open up your debug target's build settings by right-clicking on the target, hitting "Get Info", and selecting the Build tab.
- Select All (Command-A) so the entire contents of the Build setting panel is selected, then copy it to the clipboard.
- Paste the contents of the clipboard to an empty text document
- Repeat steps 1-3 for the release target of the same project
- From there you can use a diff utility or some other method to compare the contents of the two files, which will show you the settings that differ between the two configurations. Some of them will make sense (e.g., optimization settings) whereas others will not. Most likely there is a setting that differs between the two that will resolve your problem.
Another thing you can do is build one of your source files in debug mode, and in the Build Results window copy the contents of the command line to a text editor. Repeat for release mode. Then, replace each space in the command line with a newline (\r). From there you should be able to do a rough side-by-side evaluation of the differences between the two compile instructions, and may be able to figure out what's missing from that.
In general this helps you get a better feel for exactly what XCode is doing under the hood to build your project, which is a good strategy to practice no matter what tool you are using for development.