I have a library I want to use for a project for the iPhone. it has the direction to build it differently for the iPhone and the simulator:
make ARCH=i386 PLATFORM=iPhoneSimulator # Simulat开发者_开发问答or
make ARCH=armv6 PLATFORM=iPhoneOS # iPhone
Each creates a different libName.a
file to link with. how can I configure the project in xCode to link a different file for the simulator and the iPhone?
The approach is to create a fat binary. That has a binary for each target, either armv or i386. If the fat binary has been created correctly, Xcode will select the appropriate architecture automatically depending on where you are deploying (simulator or device).
You can see my answer on this here.
Also have a look at the "Framework Programming Guide", and this tutorial by Victor Costan "Fat iPhone Static Libraries: One File = Device + Simulator Code"
精彩评论