I have successfully ported a chess engine to iPhone. It's not difficult for the porting. Most of the popular chess engines adopt Universal Chess Interface Protocol or Chess Engine Communication Protocol. Read Wikipedia for more details on each protocol.
Now, say you take one of the open sources UCI chess engine and it compiles on C or C++. XCode supports C and C++ natively, so all you will need to do is copy the sources to XCode and they will compile.
The next phase would be connecting the engine to your interface. Again, this is not difficult. You will need to send protocol commands to the engine, the engine would give you back the results on standard output. You would need to pipe results using UNIX's pipe(). Read my other thread
http://stackoverflow.com/questions/3619252/fork-on-iphone for more details.
Example:
Assume engine_loop is the game loop for your engine (all engines must have a loop).
engine_loop(int fd[])
{
dup2(fd[1], STANDARD_OUTPUT);
while(true)
{
printf("e4\n"); // This is dumb, we always make the same move, but you get the idea
}
}
my_objective_c_function()
{
int fd[2];
pipe(fd);
engine_loop(fd);
char buffer[1024];
read(fd[0], buffer, 1024);
// buffer == "e4"
// Send "e4" to the interface
}
The code fragment shows you how to send results from an engine to your interface. Now, you will need to do the other way around. This is very similar to the code above. In a real scenario, once your connection is established, you will need to send UCI commands, I will give you an example:
ucinew
isready
go infinite
stop
Please read the UCI chess engine protocol documentation carefully. You will need it.